Browse code

Start before sendmail and stop after it

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@841 77e5149b-7576-45b1-b177-96237e5ba77b

Nigel Horne authored on 2004/09/09 05:48:10
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed Sep  8 21:47:09 BST 2004 (njh)
2
+----------------------------------
3
+  * contrib/init/RedHat:	Start clamav before sendmail and shut it down
4
+  					afterwards
5
+
1 6
 Wed Sep  8 17:05:08 BST 2004 (njh)
2 7
 ----------------------------------
3 8
   * libclamav/untar.c:	Fix file descriptor leak when reading a corrupt tar file
... ...
@@ -2,11 +2,12 @@
2 2
 #
3 3
 # clamav-milter This script starts and stops the clamav-milter daemon
4 4
 #
5
-# chkconfig: 2345 91 30
5
+# chkconfig: 2345 71 40
6 6
 #
7 7
 # description: clamav-milter is a daemon which hooks into sendmail and routes
8 8
 #              email messages to clamav
9 9
 # processname: clamav-milter
10
+# pidfile: /var/lock/subsys/clamav-milter
10 11
 
11 12
 # Source function library.
12 13
 . /etc/rc.d/init.d/functions
... ...
@@ -2,8 +2,8 @@
2 2
 #
3 3
 # crond   Start/Stop the clam antivirus daemon.
4 4
 #
5
-# chkconfig: 2345 90 60
6
-# description: clamd is a standard UNIX program that scans for Viruses.
5
+# chkconfig: 2345 70 41
6
+# description: clamd is a standard Linux/UNIX program that scans for Viruses.
7 7
 # processname: clamd
8 8
 # config: /usr/local/etc/clamd.conf
9 9
 # pidfile: /var/lock/subsys/clamd
... ...
@@ -20,66 +20,67 @@ progdir="/usr/local/sbin"
20 20
 
21 21
 # Source configuration
22 22
 if [ -f /etc/sysconfig/$prog ] ; then
23
-    . /etc/sysconfig/$prog
23
+	. /etc/sysconfig/$prog
24 24
 fi
25 25
 
26 26
 start() {
27
-        echo -n $"Starting $prog: "
28
-        daemon $progdir/$prog
29
-        RETVAL=$?
30
-        echo
31
-        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
32
-        return $RETVAL
27
+	echo -n $"Starting $prog: "
28
+	daemon $progdir/$prog
29
+	RETVAL=$?
30
+	echo
31
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
32
+	return $RETVAL
33 33
 }
34 34
 
35 35
 stop() {
36
-        echo -n $"Stopping $prog: "
37
-        killproc $prog
38
-        RETVAL=$?
39
-        echo
40
-        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd
41
-        return $RETVAL
36
+	echo -n $"Stopping $prog: "
37
+	# Would be better to send QUIT first, then killproc if that fails
38
+	killproc $prog
39
+	RETVAL=$?
40
+	echo
41
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd
42
+	return $RETVAL
42 43
 }
43 44
 
44 45
 rhstatus() {
45
-        status clamd
46
+	status clamd
46 47
 }
47 48
 
48 49
 restart() {
49
-        stop
50
-        start
50
+	stop
51
+	start
51 52
 }
52 53
 
53 54
 reload() {
54
-        echo -n $"Reloading clam daemon configuration: "
55
-        killproc clamd -HUP
56
-        retval=$?
57
-        echo
58
-        return $RETVAL
55
+	echo -n $"Reloading clam daemon configuration: "
56
+	killproc clamd -HUP
57
+	retval=$?
58
+	echo
59
+	return $RETVAL
59 60
 }
60 61
 
61 62
 case "$1" in
62 63
   start)
63
-        start
64
-        ;;
64
+	start
65
+	;;
65 66
   stop)
66
-        stop
67
-        ;;
67
+	stop
68
+	;;
68 69
   restart)
69
-        restart
70
-        ;;
70
+	restart
71
+	;;
71 72
   reload)
72
-        reload
73
-        ;;
73
+	reload
74
+	;;
74 75
   status)
75
-        rhstatus
76
-        ;;
76
+	rhstatus
77
+	;;
77 78
   condrestart)
78
-        [ -f /var/lock/subsys/clamd ] && restart || :
79
-        ;;
79
+	[ -f /var/lock/subsys/clamd ] && restart || :
80
+	;;
80 81
   *)
81
-        echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
82
-        exit 1
82
+	echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
83
+	exit 1
83 84
 esac
84 85
 
85 86
 exit $?