Bug 485367 - 'lsb_start_daemon' with '-p' option can't return
Summary: 'lsb_start_daemon' with '-p' option can't return
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: redhat-lsb
Version: 10
Hardware: i386
OS: Linux
low
high
Target Milestone: ---
Assignee: Lawrence Lim
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-13 02:58 UTC by Yuji Saito
Modified: 2014-03-26 00:56 UTC (History)
5 users (show)

Fixed In Version: 3.2-6.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 649814 (view as bug list)
Environment:
Last Closed: 2009-10-27 06:33:29 UTC


Attachments (Terms of Use)
patch for /etc/redhat-lsb/lsb_start_daemon (450 bytes, patch)
2009-03-17 23:19 UTC, Nick Stoughton
no flags Details | Diff
replacement patch (592 bytes, text/plain)
2009-05-12 21:47 UTC, Jon Thomas
no flags Details
patch to replace the replacement (727 bytes, patch)
2009-05-14 13:59 UTC, Jon Thomas
no flags Details | Diff
lsb_start_daemon patch to fix up cases (935 bytes, patch)
2009-05-15 15:55 UTC, Jon Thomas
no flags Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.