# chkconfig: 345 60 40
#
# description: clamd is a antivirus daemon.
+#
+# processname: clamd
+# pidfile: /var/run/clamav/clamd.pid
+#
# Source function library
# Get service config
[ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd
+RETVAL=0
# See how we were called.
case "$1" in
start)
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
else
msg_already_running clamd
- exit 1
fi
;;
stop)
if [ -f /var/lock/subsys/clamd ]; then
msg_stopping clamd
killproc clamd
- rm -f /var/run/clamd.pid /var/lock/subsys/clamd >/dev/null 2>&1
+ rm -f /var/run/clamav/clamd.pid /var/lock/subsys/clamd >/dev/null 2>&1
else
msg_not_running clamd
- exit 1
fi
;;
restart)
$0 stop
$0 start
+ exit $?
;;
status)
status clamd
exit $?
;;
- reload)
- msg_reloading clamd
- killproc clamd -HUP
+ reload|force-reload)
+ if [ -f /var/lock/subsys/clamd ]; then
+ msg_reloading clamd
+ killproc clamd -HUP
+ RETVAL=$?
+ else
+ msg_not_running clamd >&2
+ RETVAL=7
+ fi
;;
*)
- msg_usage "$0 {start|stop|restart|reload|status}"
- exit 1
+ msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+ exit 3
esac
exit $RETVAL