Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 178274 - start-stop-daemon checks for pidfile too quickly in some cases
Summary: start-stop-daemon checks for pidfile too quickly in some cases
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-13 01:56 UTC by Robin Johnson
Modified: 2007-05-14 15:14 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
If pidfile does not exist or is empty, continue (ssd-waitpid.patch,1.37 KB, patch)
2007-05-13 11:00 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-05-13 01:56:46 UTC
While creating init scripts for mogilefsd and gearmand, I ran into a bit of weirdness.

On a slow machine, the problem does not occur, but on a sufficently fast Nway box, it does.

1. start-stop-daemon --start --pidfile="${PIDFILE}" --exec ${BINARY} -- ${OPTS}
2. s-s-d starts the binary.
3a. binary forks.
3b. the parent returns 0.
3c. the child writes the pidfile.
4. s-s-d checks the pidfile.

If #4 takes place before #3c, then the pidfile will not exist, and s-s-d will report failure, despite the daemon actually being up and running.

'-R number' only works for --stop, maybe make it work for --start as well, with a default like 2 seconds if the parent has already returned 0 and the pidfile doesn't exist?
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-05-13 11:00:37 UTC
Created attachment 119105 [details, diff]
If pidfile does not exist or is empty, continue

This patch allows for an empty or non existant pidfile for the duration of the alive test. If at the end of the test the pidfile is still empty or non existant we think the daemon has died.

Does this fix things for you?
Comment 2 Roy Marples (RETIRED) gentoo-dev 2007-05-14 15:14:29 UTC
Fixed in alpha3