monit-general
[Top][All Lists]
Advanced

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

Re: [monit] Monitoring processes without a pidfile


From: Daniel Clark
Subject: Re: [monit] Monitoring processes without a pidfile
Date: Tue, 22 Jul 2008 17:05:22 -0400

On 7/22/08, Brian Downey <address@hidden> wrote:
>
>  On Jul 22, 2008, at 1:04 PM, Daniel Clark wrote
>
> >
> > The example script didn't work for me, because the service would fork
> > off another process as part of becoming a daemon. The below ugly shell
> > code seems to do the trick, but makes me think I should just use
> > runit/daemontools for this after all...
> >
> >
>  <snip>
>
> > CMD="$DIR/bin/logpp -d -r 5 -t www.example.com -l debug $DIR/etc/$ME.conf"
> >
>
>  Did you try "exec" in front of the command?  That will let the child
> inherit
>  the script's pid & environment upon termination.

Yep; the first thing I tried was pretty much verbatim what was in the
FAQ. The problem is that the script inherits the PID of the initial
"logpp" processes, but then the "logpp" process daemonizes itself
under a different PID; so the PIDFILE ends up being a process ID of a
process that lasted about 1 second and only existed to create another
process.

-- 
Daniel JB Clark # http://opensysadmin.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]