Ari Arantes Filho wrote:
> > env - PATH="$PATH" svscan &
> > echo $! > /var/run/svscan.pid
Martin Akesson wrote:
> You are getting the pid of the env program. You must start svscan
> without a wrapper like env in order to get echo $! to work.
His script is based on Dave Sill's LWQ start-up script. Assuming I'm
understanding it correctly, recording the PID of the env program is not a
problem, since it morphs into svscan. In other words, killing env will in
turn kill svscan.
Ari Arantes Filho also wrote:
> > # begin ------ /var/qmail/supervise/pop3d/run ------
> >
> > #!/bin/sh
> > /usr/local/bin/tcpserver -v -R 0 pop-3 /var/qmail/bin/qmail-popup
> > myserver.domain.com \
> > /bin/checkpassword /var/qmail/bin/qmail-pop3d Maildir 2>&1
Here's the real problem. Coincidentally, I ran into this same pitfall
myself just yesterday. Put "exec" in front of the tcpserver command in this
script.
My understanding is that supervise is actually only supervising the run
script. The "exec" command tells the script to turn itself into a tcpserver
process. Without the "exec", the script creates a separate tcpserver
process, which supervise cannot control.
---Kris Kelley