]> git.pld-linux.org Git - packages/clamav.git/blob - clamav.init
- networking isn't used, so don't source the config
[packages/clamav.git] / clamav.init
1 #!/bin/sh
2 #
3 # clamd         clamd (antyvirus daemon)
4 #
5 # chkconfig:    345 60 40
6 #
7 # description:  clamd is a antivirus daemon.
8 #
9 # processname:  clamd
10 # pidfile:      /var/run/clamav/clamd.pid
11 #
12
13
14 # Source function library
15 . /etc/rc.d/init.d/functions
16
17 # Get service config
18 [ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd
19
20 RETVAL=0
21 # See how we were called.
22 case "$1" in
23   start)
24         # Check if the service is already running?
25         if [ ! -f /var/lock/subsys/clamd ]; then
26                 msg_starting clamd
27                 daemon /usr/sbin/clamd
28                 RETVAL=$?
29                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
30         else
31                 msg_already_running clamd
32         fi
33         ;;
34   stop)
35         if [ -f /var/lock/subsys/clamd ]; then
36                 msg_stopping clamd
37                 killproc --pidfile clamav/clamd.pid clamd
38                 rm -f /var/run/clamav/clamd.pid /var/lock/subsys/clamd >/dev/null 2>&1
39         else
40                 msg_not_running clamd
41         fi
42         ;;
43   restart)
44         $0 stop
45         $0 start
46         exit $?
47         ;;
48   status)
49         status clamd
50         exit $?
51         ;;
52   reload|force-reload)
53         if [ -f /var/lock/subsys/clamd ]; then
54                 msg_reloading clamd
55                 killproc clamd -HUP
56                 RETVAL=$?
57         else
58                 msg_not_running clamd >&2
59                 RETVAL=7
60         fi
61         ;;
62   *)
63         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
64         exit 3
65 esac
66
67 exit $RETVAL
This page took 0.026888 seconds and 4 git commands to generate.