#!/bin/sh # # clamd Init Script to start/stop clamd. # # chkconfig: - 61 39 # description: clamd is an antivirus daemon. # # processname: clamd # config: /etc/clamd.conf # pidfile: /var/run/clamav/clamd.pid # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network test -f /etc/clamd.conf || exit 0 RETVAL=0 start() { echo -n $"Starting Clam AV daemon: " daemon /usr/sbin/clamd RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd return $RETVAL } stop() { echo -n $"Stopping Clam AV daemon: " killproc clamd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/run/clamav/clamd.pid /var/lock/subsys/clamd return $RETVAL } restart() { stop start } reload() { echo -n $"Reloading DB: " killproc clamd -USR2 RETVAL=$? echo return $RETVAL } case "$1" in start) start ;; stop) stop ;; status) status clamd ;; restart) restart ;; condrestart) [ -f /var/lock/subsys/clamd ] && restart || : ;; reload) reload ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" exit 1 esac exit $?