switching from clamavmodule -> clamd... source?

Ugo Bellavance ugob at lubik.ca
Mon Jul 9 17:17:55 IST 2007


Martin.Hepworth wrote:
> Mine is for FreeBSd so will be slightly different as it's using
> FreeBSD's macros'..

Ok,

I didnt' think quickly enough... here is the one used by dag's clamd rpm 
package:

---------------------------
#!/bin/sh
#
# Startup script for the Clam AntiVirus Daemon
#
# chkconfig: 2345 61 39
# description: Clam AntiVirus Daemon is a TCP/IP or socket protocol \
#              server.
# processname: clamd
# pidfile: /var/run/clamav/clamd.pid
# config: /etc/clamav.conf

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

[ -x /usr/sbin/clamd ] || exit 0

# See how we were called.
case "$1" in
   start)
         echo -n "Starting Clam AntiVirus Daemon: "
         daemon clamd
         RETVAL=$?
         echo
         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
         ;;
   stop)
         echo -n "Stopping Clam AntiVirus Daemon: "
         killproc clamd
         rm -f /var/clamav/clamd.socket
         rm -f /var/run/clamav/clamav.pid
         RETVAL=$?
         echo
### heres the fix... we gotta remove the stale files on restart
         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd
         ;;
   status)
         status clamd
         RETVAL=$?
         ;;
   restart|reload)
         $0 stop
         $0 start
         RETVAL=$?
         ;;
   condrestart)
         [ -e /var/lock/subsys/clamd ] && restart
         RETVAL=$?
         ;;
   *)
         echo "Usage: clamd {start|stop|status|restart|reload|condrestart}"
         exit 1
esac

exit $RETVAL



More information about the MailScanner mailing list