Bug 485367 - 'lsb_start_daemon' with '-p' option can't return
'lsb_start_daemon' with '-p' option can't return
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: redhat-lsb (Show other bugs)
10
i386 Linux
low Severity high
: ---
: ---
Assigned To: Lawrence Lim
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-12 21:58 EST by Yuji Saito
Modified: 2014-03-25 20:56 EDT (History)
5 users (show)

See Also:
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 02:33:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Yuji Saito 2009-02-12 21:58:52 EST
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 19:19:30 EDT
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 17:47:50 EDT
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 09:59:40 EDT
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 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 5 Jonathan Fournier 2009-08-25 21:29:05 EDT
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 14:07:03 EDT
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 14:07:08 EDT
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 02:33:22 EDT
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 03:08:33 EDT
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.