Bug 485367

Summary: 'lsb_start_daemon' with '-p' option can't return
Product: [Fedora] Fedora Reporter: Yuji Saito <Saito.Yuji6>
Component: redhat-lsbAssignee: Lawrence Lim <llim>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 10CC: hidenori.ishii, hliu, jonathan.fournier, llim, tools-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 3.2-6.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 649814 (view as bug list) Environment:
Last Closed: 2009-10-27 06:33:29 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:
Attachments:
Description Flags
patch for /etc/redhat-lsb/lsb_start_daemon
none
replacement patch
none
patch to replace the replacement
none
lsb_start_daemon patch to fix up cases none

Description Yuji Saito 2009-02-13 02:58:52 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; ja; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6

I am making an LSB 3.2 compliant printer driver package which has daemon.
when I start my daemon with '-p' option using start_daemon function in /lib/lsb/init-functions,
it freeze.


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. (it cause infinite loop.)



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>

the same problem is in redhat-lsb-3.1-19.fc8.i386.rpm on Fedora9.

Comment 1 Nick Stoughton 2009-03-17 23:19:30 UTC
Created attachment 335619 [details]
patch for /etc/redhat-lsb/lsb_start_daemon

The attached patch correctly passes the -p argument through, breaking the forever loop.

Comment 2 Jon Thomas 2009-05-12 21:47:50 UTC
Created attachment 343667 [details]
replacement patch

I think the previous patch didn't actually collect and pass on the pid file name.

Comment 3 Jon Thomas 2009-05-14 13:59:40 UTC
Created attachment 343968 [details]
patch to replace the replacement

In second thought, this is probably a better patch.

Comment 4 Jon Thomas 2009-05-15 15:55:36 UTC
Created attachment 344190 [details]
lsb_start_daemon patch to fix up cases

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

Comment 5 Jonathan Fournier 2009-08-26 01:29:05 UTC
I'm still having the same issue with Fedora 11

/etc/redhat-lsb/lsb_start_daemon wrapping /etc/init.d/functions daemon()

start_daemon loads the CPU to 100%.

Comment 6 Fedora Update System 2009-10-21 18:07:03 UTC
redhat-lsb-3.2-6.fc10.1 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/redhat-lsb-3.2-6.fc10.1

Comment 7 Fedora Update System 2009-10-21 18:07:08 UTC
redhat-lsb-3.2-6.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/redhat-lsb-3.2-6.fc11

Comment 8 Fedora Update System 2009-10-27 06:33:22 UTC
redhat-lsb-3.2-6.fc10.1 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2009-10-27 07:08:33 UTC
redhat-lsb-3.2-6.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.