clamav/clamav.init

58 lines
1.1 KiB
Plaintext
Raw Normal View History

2011-02-21 21:42:47 +00:00
#!/bin/sh
#
# Startup script for the Clam AntiVirus Daemon
#
2011-03-15 17:23:41 +00:00
# chkconfig: - 61 39
2011-02-21 21:42:47 +00:00
# description: Clam AntiVirus Daemon is a TCP/IP or socket protocol \
# server.
# processname: clamd
# pidfile: /var/run/clamav/clamd.pid
# config: /etc/clamd.conf
2011-02-21 21:42:47 +00:00
# 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/run/clamav/clamd.sock
rm -f /var/run/clamav/clamd.pid
2011-02-21 21:42:47 +00:00
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 ] && $0 restart
2011-02-21 21:42:47 +00:00
RETVAL=$?
;;
*)
echo "Usage: clamd {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit $RETVAL