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?
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?
Fixed in alpha3