> > #!/bin/sh > > exec 1>>/var/log/messages > > exec 2>&1 > > TIMESTAMP=`date +"%b %e %H:%M:%S"` > > # check for clamd daemon > > if skill -n clamd > > then > > echo $TIMESTAMP " clamd is running" > > else > > echo $TIMESTAMP " restarting clamd daemon" > > rm /var/amavisd/clamd.sock > > chroot -u amavisd /var/amavisd /usr/sbin/clamd > > fi > > > > ******************* > > Lynn, what do you mean saying "It starts multiple clamd > daemons"? Isn't this, by chance, the normal clamd behaviour, like in: > > 14528 ? S 0:03 /usr/sbin/clamd > 14529 ? S 0:14 /usr/sbin/clamd > 14530 ? S 0:24 /usr/sbin/clamd > > There are multiple (3) processes (or maybe threads) and it's normal. > > Sorry if I'm asking obvious questions.
When run from the command line the if condition works properly and identifies when the clamd daemon is running and just exits with an 2 lines in the message log. i.e.: 22779 Aug 18 12:13:25 clamd is running If it is not running it deletes the clamd.sock and starts clamd daemon, logging : skill: no matching processes Aug 18 12:16:08 restarting clamd daemon rm: /var/amavisd/clamd.sock: No such file or directory Current working dir is /usr/local/share/clamav When run from crontab the if statement always runs the "else" whether clamd is running or not. Thus the multiple copies of clamd. ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Clamav-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/clamav-users