[Avcheck] kavdaemon init Skript
Piotr Klaban
makler@man.torun.pl
Wed, 29 Aug 2001 09:04:41 +0200
On Wed, Aug 29, 2001 at 12:12:59AM +0400, Michael Tokarev wrote:
> > ./kavdaemon -dl -f=/ctl /tst > /dev/null
> > ./kavdaemon -k -f=/ctl
Now you should see the difference.
> ;) What is the difference between start and stop?
The difference is that stop uses -k switch (avp had that switch
for ages as I remember).
> Should `stop' case look like
>
> > 'stop')
> > if [ -f /var/spool/avp/ctl/AvpPid ]; then
> > read pid < /var/spool/avp/ctl/AvpPid
> > kill $pid 2>/dev/null && echo "AVP daemon stopped"
> > fi
Yes, it works too.
Avp -k uses almost the same kill:
21953: unlink("/ctl/AvpPid") = 0
21953: unlink("/ctl/AvpCtl") = 0
21953: kill(15867, SIGTERM) = 0
What is missing here is the check for return code
in the start case.
--
Piotr Klaban