[IRCServices Coding] Re: IRCServices-Coding digest, Vol 1 #125 - 3 msgs
VisionOfHell at aol.com
VisionOfHell at aol.com
Fri May 10 08:35:28 PDT 2002
At a guess id say more specifically:
1) It has worked with non v5
2) The pid is created and then once it becomes stale disappears
3) I see nothing wrong with below
#!/bin/sh
servicesdir="/home/chris/servers/services/bin"
piddir="/home/chris/servers/services/lib"
name="ircservices"
########## you probably don't need to change anything below here ##########
cd $piddir
if test -r $name.pid; then
# there is a pid file -- is it current?
mypid=`cat $name.pid`
if `kill -CHLD $mypid >/dev/null 2>&1`; then
# it's still going
# back out quietly
exit 0
fi
echo ""
echo "Stale $name.pid file (erasing it)"
rm -f $name.pid
fi
echo ""
echo "Couldn't find the daemon running. Reloading it..."
echo ""
cd $servicesdir
./$name
exit 0