I'm writing startup/shutdown scripts for clam daemons for Mac OS 10. They're
working ok except I can't seem to do a clean shutdown of clamd -- sending it
'kill -TERM' does nothing, I have to 'kill -9' to stop it. Here's my
start/stop code:

StartService ()
{
    if ! pid=$(GetPID clamd); then
        KillSockets
        ConsoleMessage "Starting clamd daemon"
        /opt/local/sbin/clamd
        sleep 5
        ConsoleMessage "Starting clamav-milter daemon"
        /opt/local/sbin/clamav-milter -loq /var/run/clamav/clmilter.sock
        sleep 5
        ConsoleMessage "Starting freshclam daemon"
        /opt/local/bin/freshclam -d
    fi
}

StopService ()
{
    if pid=$(GetPID clamd); then
        ConsoleMessage "pid = $pid"
        ConsoleMessage "Stopping clamav-milter daemon"
        killall -TERM clamav-milter
        ConsoleMessage "Stopping clamd daemon"
        kill -TERM $pid
        ConsoleMessage "Stopping freshclam daemon"
        killall -TERM freshclam
    else
        ConsoleMessage "clamd is not running."
    fi
}


Why won't 'kill -TERM' work?

 
--
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Design/Development
WebObjects Hosting
Mac Consulting/Sales

http://www.systame.com/




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to