# description: Clam Antivirus daemon
#
# processname: clamd
-# pidfile: /var/run/clamav/clamd.pid
+# pidfile: /var/run/clamav/clamd.pid
#
# $Id$
start() {
# Check if the service is already running?
- if [ ! -f /var/lock/subsys/clamd ]; then
- msg_starting "Clam Antivirus daemon"
- daemon /usr/sbin/clamd
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
- else
+ if [ -f /var/lock/subsys/clamd ]; then
msg_already_running "Clam Antivirus daemon"
+ return
fi
+
+ msg_starting "Clam Antivirus daemon"
+ daemon --pidfile /var/run/clamav/clamd.pid /usr/sbin/clamd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
}
stop() {
- if [ -f /var/lock/subsys/clamd ]; then
- msg_stopping "Clam Antivirus daemon"
- killproc --pidfile clamav/clamd.pid clamd
- rm -f /var/run/clamav/clamd.pid /var/lock/subsys/clamd >/dev/null 2>&1
- else
+ if [ ! -f /var/lock/subsys/clamd ]; then
msg_not_running "Clam Antivirus daemon"
+ return
fi
+
+ msg_stopping "Clam Antivirus daemon"
+ killproc --pidfile /var/run/clamav/clamd.pid clamd
+ rm -f /var/lock/subsys/clamd /var/run/clamav/clamd.pid >/dev/null 2>&1
}
reload() {
# See how we were called.
case "$1" in
start)
- start
+ start
;;
stop)
- stop
+ stop
;;
restart)
stop
condrestart 0
;;
reload|force-reload)
- reload
+ reload
;;
status)
status clamd