Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 285801 - sys-apps/openrc-0.4.3-r3: WAIT_PIDFILE needs to be configurable
Summary: sys-apps/openrc-0.4.3-r3: WAIT_PIDFILE needs to be configurable
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Roy Marples
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-21 01:58 UTC by Robin Johnson
Modified: 2009-09-21 06:15 UTC (History)
1 user (show)

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


Attachments

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 2009-09-21 01:58:18 UTC
While trying to trace why several apps (all written in Perl) on my system always report 'crashed' status, I ultimately traced it to the WAIT_PIDFILE interval being too short.

The apps follow the following pattern:
1. startup
2. basic checks
3. fork() to daemon
3.1. original exec returns to s-s-d
4. daemon does more complex checks
5. daemon writes pidfile.

If #4 takes longer than the WAIT_PIDFILE interval, then it will do one of two things:
1. If --pidfile was NOT specified, s-s-d reports successful start, but later reports status as 'crashed'.
2. If --pidfile was specified, s-s-d fails hard, with:
start-stop-daemon: did not create a valid pid in `$FOO'
Comment 1 Roy Marples 2009-09-21 06:14:50 UTC
Obviously the daemon should carry out complex checks AND writes the pidfile BEFORE forking. Any other situation is prone to racing.

But this bug is invalid anyway - OpenRC-0.5 ditched WAIT_PIDFILE and now supports 3 ways of setting it - command line -w N, env var SSD_STARTWAIT=N or rc_start_wait set in a configuration file. The default is 0.