Start before sendmail and stop after it

git-svn: trunk@841
remotes/push_mirror/metadata
Nigel Horne 21 years ago
parent eba8ebeb7c
commit a17ecfc971
  1. 5
      clamav-devel/ChangeLog
  2. 3
      clamav-devel/contrib/init/RedHat/clamav-milter
  3. 75
      clamav-devel/contrib/init/RedHat/clamd

@ -1,3 +1,8 @@
Wed Sep 8 21:47:09 BST 2004 (njh)
----------------------------------
* contrib/init/RedHat: Start clamav before sendmail and shut it down
afterwards
Wed Sep 8 17:05:08 BST 2004 (njh) Wed Sep 8 17:05:08 BST 2004 (njh)
---------------------------------- ----------------------------------
* libclamav/untar.c: Fix file descriptor leak when reading a corrupt tar file * libclamav/untar.c: Fix file descriptor leak when reading a corrupt tar file

@ -2,11 +2,12 @@
# #
# clamav-milter This script starts and stops the clamav-milter daemon # clamav-milter This script starts and stops the clamav-milter daemon
# #
# chkconfig: 2345 91 30 # chkconfig: 2345 71 40
# #
# description: clamav-milter is a daemon which hooks into sendmail and routes # description: clamav-milter is a daemon which hooks into sendmail and routes
# email messages to clamav # email messages to clamav
# processname: clamav-milter # processname: clamav-milter
# pidfile: /var/lock/subsys/clamav-milter
# Source function library. # Source function library.
. /etc/rc.d/init.d/functions . /etc/rc.d/init.d/functions

@ -2,8 +2,8 @@
# #
# crond Start/Stop the clam antivirus daemon. # crond Start/Stop the clam antivirus daemon.
# #
# chkconfig: 2345 90 60 # chkconfig: 2345 70 41
# description: clamd is a standard UNIX program that scans for Viruses. # description: clamd is a standard Linux/UNIX program that scans for Viruses.
# processname: clamd # processname: clamd
# config: /usr/local/etc/clamd.conf # config: /usr/local/etc/clamd.conf
# pidfile: /var/lock/subsys/clamd # pidfile: /var/lock/subsys/clamd
@ -20,66 +20,67 @@ progdir="/usr/local/sbin"
# Source configuration # Source configuration
if [ -f /etc/sysconfig/$prog ] ; then if [ -f /etc/sysconfig/$prog ] ; then
. /etc/sysconfig/$prog . /etc/sysconfig/$prog
fi fi
start() { start() {
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
daemon $progdir/$prog daemon $progdir/$prog
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
return $RETVAL return $RETVAL
} }
stop() { stop() {
echo -n $"Stopping $prog: " echo -n $"Stopping $prog: "
killproc $prog # Would be better to send QUIT first, then killproc if that fails
RETVAL=$? killproc $prog
echo RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd echo
return $RETVAL [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd
return $RETVAL
} }
rhstatus() { rhstatus() {
status clamd status clamd
} }
restart() { restart() {
stop stop
start start
} }
reload() { reload() {
echo -n $"Reloading clam daemon configuration: " echo -n $"Reloading clam daemon configuration: "
killproc clamd -HUP killproc clamd -HUP
retval=$? retval=$?
echo echo
return $RETVAL return $RETVAL
} }
case "$1" in case "$1" in
start) start)
start start
;; ;;
stop) stop)
stop stop
;; ;;
restart) restart)
restart restart
;; ;;
reload) reload)
reload reload
;; ;;
status) status)
rhstatus rhstatus
;; ;;
condrestart) condrestart)
[ -f /var/lock/subsys/clamd ] && restart || : [ -f /var/lock/subsys/clamd ] && restart || :
;; ;;
*) *)
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
exit 1 exit 1
esac esac
exit $? exit $?

Loading…
Cancel
Save