Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 184207

Summary: start-stop-daemon --pidfile requires a working pidfile
Product: Gentoo Linux Reporter: Slawomir Gasiorowski <sgasiorowski>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WONTFIX    
Severity: major CC: jakub
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 169002    
Bug Blocks:    

Description Slawomir Gasiorowski 2007-07-04 17:07:02 UTC
quite often i have a bug with start-stop-daemon depended daemons (sshd, apache, nscd, xdm and many others...) similar to this:

/sbin/start-stop-daemon: /usr/sbin/apache2 died
ERROR: apache2 failed to start 

... but it doesn't mean that apache for example doesn't work. I can say more, these daemons always work properly, even the script has failed.

I've discovered that when I remove a piece of code:

if (retestpid) {
        if (do_stop (NULL, NULL, pidfile, uid, 0, true, false, true) < 1)
                eerrorx ("%s: %s died", progname, exec);
} 

in start-stop-daemon.c(1032) the problem disappeared and everything works fine. I know that this dirty hack is does not solve this problem. That's why I'm writing about this bug here.

Reproducible: Sometimes

Steps to Reproduce:
This bug appears mostly during booting sequence. Probablility increases when RC_PARALLEL_STARTUP is set to "yes". Manually it's hard to reproduce.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-07-04 18:25:51 UTC
Daemons should not return until a valid and working pidfile is available and working. Otherwise races can happen - and this bug too. apache2 and ntpd are good example of this. We have a patch for ntp available on bug #169002, although upstream don't like it.

I would create a new bug for each daemon you have this problem with and add it as a dependency to this bug.

ssh, xdm (+kdm +gdm) and nscd should all work without error though - at least they do on my boxes.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-07-04 19:12:13 UTC
Just one note here - Slawomir, please, don't bug baselayout people about apache initscript issues; it's been discussed over and over again on Bug 110556 and numerous duplicates.

Gentoo apache maintainers have no intentions to keep hacking on this. If latest initscripts shipped w/ apache-2.2.4-r7 do not work for you, feel free to introduce whatever sleep and whatnot hacks there, we won't do it. The only fix that would be considered is fixing apache to behave (i.e., do not return success until the pidfile has been created on start, and do not return success until all apache processes have stopped on stop/restart - as Uberlord noted above.)

Thanks.
Comment 3 Roy Marples (RETIRED) gentoo-dev 2007-07-11 11:41:37 UTC
Open bugs for the daemons in question, not baselayout.