Bug 649814

Summary: 'lsb_start_daemon' with '-p' option can't return
Product: Red Hat Enterprise Linux 5 Reporter: Richard Ash <richardashaudacity>
Component: redhat-lsbAssignee: Ondrej Vasik <ovasik>
Status: CLOSED CURRENTRELEASE QA Contact: desktop-bugs <desktop-bugs>
Severity: high Docs Contact:
Priority: low    
Version: 5.5CC: hidenori.ishii, hliu, jonathan.fournier, llim, pasteur, Saito.Yuji6
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: redhat-lsb-4.0-2.1.4.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 485367 Environment:
Last Closed: 2013-03-08 12:43:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard Ash 2010-11-04 15:57:45 UTC
+++ This bug was initially created as a clone of Bug #485367 +++
Using the LSB-mandated lsb_start_daemon shell function with the LSB-mandated -p option puts the code into an endless loop and never starts the daemon.

Reproducible: Always

Steps to Reproduce:
call start_daemon function in the init script like this,
----
. /lib/lsb/init-functions
start_daemon -p /var/run/${DAEMON}.pid /pathto/${DAEMON}
----

Actual Results:  
freeze. (causes infinite loop in shell code)

The reason is in /etc/redhat-lsb/lsb_start_daemon.
the while loop in lsb_start_daemon don't read "-p" option.
so it cause infinite loop.

according to LSB 3.2 and LSB3.1 spec, start_daemon accepts "-p" ottion.
<http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html>
<http://refspecs.linux-foundation.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html>

This problem also affects Centos 5.5 (bug http://bugs.centos.org/view.php?id=4575) in the redhat-lsb-3.1 package.

--- Additional comment from jthomas on 2009-05-15 11:55:36 EDT ---

Created attachment 344190 [details]
lsb_start_daemon patch to fix up cases

ok, here's the last revision. I swear.

Comment 1 Richard Ash 2010-11-05 15:26:25 UTC
Applying the patch in the attachment fixes the problem for Centos 5.5.

Comment 2 Ondrej Vasik 2013-03-08 12:43:14 UTC
Closing CURRENTRELEASE, there should not be any deadlock in the recent redhat-lsb RHEL-5 packages. Package redhat-lsb-4.0-2.1.4.el5 (released in January 2011) and later packages should work just fine.