[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [SRM] Update of dns-flood-detector



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:phil@0x539.de
  `-    finger pkern/key@db.debian.org

Attachment: signature.asc
Description: Digital signature


Reply to: