having a sinister problem.

I have modfied a SysV script to start the clamd and than clam-milter. when I 
check status I get:

[r...@smtp ~]# /etc/init.d/clamav-milter status
clamav-milter (pid 3432) is running...
clamd (pid 3426) is running...

I send an email and the header has :

X-Virus-Status: Clean
X-Virus-Scanned: clamav-milter 0.96 at smtp.inksystemsinc.com



I come back a few days later and I get this:

[r...@smtp ~]# /etc/init.d/clamav-milter status
clamav-milter dead but subsys locked
clamd (pid 5152) is running...


and my emails do not include the X-Virus-Status info.



Files to follow (- comment sections):


[r...@smtp ~]# more /usr/local/etc/clamd.conf 
LogFacility LOG_LOCAL6
PidFile /var/run/clamd/clamd.pid
OfficialDatabaseOnly no
LocalSocket /var/run/clamd/clamd.socket


[r...@smtp ~]# more /usr/local/etc/clamav-milter.conf 
MilterSocket /var/run/clamd/clamav-milter.socket
User clamav 
PidFile /var/run/clamd/clamav-milter.pid
ClamdSocket unix:/var/run/clamd/clamd.socket
ReportHostname smtp.inksystemsinc.com
LogTime yes
LogSyslog yes
LogFacility LOG_LOCAL6
LogInfected Basic


[r...@smtp ~]# more /etc/init.d/clamav-milter 
#!/bin/sh
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
CLAMAV_FLAGS=
test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter
[ ${NETWORKING} = "no" ] && exit 0

PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin

RETVAL=0

start_clamd() {

    # ADD BY SHAWN 04122010 for new ClamAV implementation 
    echo -n "Starting clam AV Server: "
    touch /var/lock/subsys/clamd

    if [ -x /sbin/restorecon ] ; then
        /sbin/restorecon /var/lock/subsys/clamd
    fi

        LANG= daemon clamd ${CLAMD_FLAGS}
        RETVAL=$?
        echo
        test $RETVAL -eq 0
        return $RETVAL
}

start_clamilt() {

        echo -n "Starting clamav-milter: "
    # Don't allow files larger than 20M to be created, to limit DoS
    # Needs to be large enough to extract the signature files
    ulimit -f 20000
    touch /var/lock/subsys/clamav-milter
# SE Linux Fix from http://webui.sourcelabs.com/fedora/issues/447247 (and in 
spamass-miter)

    if [ -x /sbin/restorecon ] ; then 
        /sbin/restorecon /var/lock/subsys/clamav-milter
    fi
     
    LANG= daemon clamav-milter ${CLAMAV_FLAGS}
        RETVAL=$?
        echo
    test $RETVAL -eq 0
    return $RETVAL
}


start() {

    start_clamd
    start_clamilt
}


stop_clamd() {

    echo -n "Shuttung down clamd: "
    killproc clamd
        RETVAL=$?
        echo
        test $RETVAL -eq 0 && rm -f /var/lock/subsys/clamd

}

stop_clamilt() {
        echo -n "Shutting down clamav-milter: "
        killproc clamav-milter
        RETVAL=$?
        echo
    test $RETVAL -eq 0 && rm -f /var/lock/subsys/clamav-milter
}


stop() {

    stop_clamilt
    stop_clamd
}


restart() {
    stop
    start
}

# See how we were called.
case "$1" in
  start)
    case "$2" in
        clamd)
        start_clamd
        ;;
        clamilt)
        start_clamilt
        ;;
        *)
        start
            ;;
    esac
    ;;
  stop)
    case "$2" in
        clamd)
        stop_clamd
        ;;
        clamilt)
        stop_clamilt
        ;;
        *)
        stop
            ;;
       esac
    ;; 
  restart|reload)
    restart
        ;;
  condrestart)
    test -f /var/lock/subsys/clamav-milter && -f /var/lock/subsys/clamd && 
restart || :
        ;;
  status)
        status clamav-milter
        status clamd
        ;;
  *)
        echo "Usage: $0 
{start[clamd|clamilt]|stop[clamd|clamilt]|reload|restart|condrestart|status}"
        exit 1
esac

exit $?

                                          
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to