* Lynn Duerksen <[EMAIL PROTECTED]> [20031128 18:58]: wrote: > > > Subject: Re: [Clamav-users] Autochecking script for clamd > > > > > > At 08:50 PM 11/27/2003, Brian Bruns wrote: > > >Well, I should have put this in the last message. > > > > > >I guess the one I threw together doesn't require anything special > > >(doesn't need daemontools), and only needs bash. I have a habit of > > >writing things very simply to be as small and lightweight as > > possible > > >:) > > > > daemontools isn't "special", whatever that means, and bash shells are > > neither small nor lightweight. so, you lose on all counts. > > > > Special is as Special Does! > > I use a simple shell script to check for clamd and freshclam since there > have been versions where both/either died. Plus I timestamp and log. > > As far as daemontools, I could never get it to function properly on my > OpenBSD - Postfix - Amavisd system. This simple script works great. > > #!/bin/sh > # redirect output to /var/log/messages file > exec 1>>/var/log/checkclam > exec 2>&1 > TIMESTAMP=`date +"%b %e %H:%M:%S"` > # Check for clamd daemon > if ! (ps -aU amavisd | grep clamd | grep -v grep > /dev/null) > then > echo $TIMESTAMP "restarting clamd" > # Remove Stale Socket > rm /var/amavisd/clamd.sock > # Start clamd > /usr/local/sbin/clamd > # Timestamp, log and send me a note > echo $TIMESTAMP "restarting clamd" > /tmp/clamrestart.txt > cat /tmp/clamrestart.txt | mail -s "clamd restart report" > [EMAIL PROTECTED] > /dev/null > rm /tmp/clamrestart.txt > /dev/null > fi > if ! (ps -aU amavisd | grep freshclam | grep -v grep > /dev/null) > then > echo $TIMESTAMP " restarting freshclam daemon" > /usr/local/bin/freshclam -d -c 4 > --datadir=/var/amavisd/usr/local/share/clamav --log-verbose > fi > > > FYI - Since installing 0.65 this has recorded no restarts
Well, but why run freshclam all the time? cheers - wash +----------------------------------+-----------------------------------------+ Odhiambo Washington . WANANCHI ONLINE LTD (Nairobi, KE) | <wash at wananchi dot com> . 1ere Etage, Loita Hse, Loita St., | GSM: (+254) 722 743 223 . # 10286, 00100 NAIROBI | GSM: (+254) 733 744 121 . (+254) 020 313 985 - 9 | +---------------------------------+------------------------------------------+ "Oh My God! They killed init! You Bastards!" --from a /. post
smime.p7s
Description: S/MIME cryptographic signature