On Sat, Mar 22, 2008 at 12:44:46AM +0100, Jan Wagner wrote: > On Friday 21 March 2008 23:36, Philipp Kern wrote: > > The approach looks weird to me. Wouldn't it be more sensible to just > > write out a pid file in the daemon? (i.e. in daemonize, and probably > > add a configuration option for it) > For testing/unstable I would say, this is an adequate solution. But for > stable > I would prefer to not have a chance to mess up the code where it can be done > with a oneliner in the initscript. Of course it's a bit ugly, but it works as > expected.
Then please depend on psmisc. Your method is *not* reliable. It depends on the PID sequence number. You are using a shell script and invoke `ps aux | grep $DAEMON' which means that $DAEMON will appear as part of the cmdline of the grep invokation. If the $DAEMON PID is lower than the grep it will be written to the pid file, otherwise the PID of the grep process will be written. Kind regards, Philipp Kern -- .''`. Philipp Kern Debian Developer : :' : http://philkern.de Debian Release Assistant `. `' xmpp:[EMAIL PROTECTED] `- finger pkern/[EMAIL PROTECTED]
signature.asc
Description: Digital signature