Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/sh
2
#
3
# Startup script for the Clam AntiVirus Daemon
4
#
5
# chkconfig: - 61 39
6
# description: Clam AntiVirus Daemon is a TCP/IP or socket protocol \
7
#              server.
8
# processname: clamd
9
# pidfile: /var/run/clamav/clamd.pid
10
# config: /etc/clamd.conf
11
 
12
# Source function library.
13
. /etc/rc.d/init.d/functions
14
 
15
# Source networking configuration.
16
. /etc/sysconfig/network
17
 
18
[ -x /usr/sbin/clamd ] || exit 0
19
 
20
# See how we were called.
21
case "$1" in
22
  start)
23
	echo -n "Starting Clam AntiVirus Daemon: "
24
	daemon clamd
25
	RETVAL=$?
26
	echo
27
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
28
	;;
29
  stop)
30
	echo -n "Stopping Clam AntiVirus Daemon: "
31
	killproc clamd
32
	rm -f /var/run/clamav/clamd.sock
33
	rm -f /var/run/clamav/clamd.pid
34
	RETVAL=$?
35
	echo
36
### heres the fix... we gotta remove the stale files on restart
37
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd
38
	;;
39
  status)
40
	status clamd
41
	RETVAL=$?
42
	;;
43
  restart|reload)
44
	$0 stop
45
	$0 start
46
	RETVAL=$?
47
	;;
48
  condrestart)
49
	[ -e /var/lock/subsys/clamd ] && $0 restart
50
	RETVAL=$?
51
	;;
52
  *)
53
	echo "Usage: clamd {start|stop|status|restart|reload|condrestart}"
54
	exit 1
55
esac
56
 
57
exit $RETVAL