Steven Spence said:
> Ronny Nussbaum wrote:
>
>> Is this what you're looking for?:
>
> I think he is looking more for something to make
> sure it is still running and restart it if it
> has died.
>
>
Such as this watchdog (clamd.sh, unchecked, from memory):
#!/bin/sh
# Written for Solaris
# run as usr root
# start clamd, loop forever, restart if needed
# notify usr admin via email
# not appropriate as an rc script as it never quits
startup()
{
su clamav -c /usr/local/sbin/clamd >/dev/null 2>&1
}
# loop every 15 seconds, check for clamd, restart if not found
while [ 1 ]; do # forever
if /usr/bin/pgrep -x clamd >/dev/null 2>&1; then
: # do nothing
else
startup
echo "restarted clamd on `uname -n`" |mailx -s "`uname -n`: restarted
clamd" admin >/dev/null 2>&1
fi
sleep 15
done
# should never get here
exit 0
dp
_______________________________________________
http://lurker.clamav.net/list/clamav-users.html