#!/bin/sh # # amavisd Start/Stop the amavisd daemon. # # chkconfig: 345 40 60 # # description: amavisd is daemonized antivirus daemon # # processname: amavisd # config: /etc/amavisd.conf # pidfile: /var/lock/subsys/amavisd # Source function library . /etc/rc.d/init.d/functions # Get service config [ -f /etc/sysconfig/amavisd ] && . /etc/sysconfig/amavisd RETVAL=0 # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/amavisd ]; then msg_starting Amavisd daemon 'su -s /bin/sh amavis -c "/bin/nice /usr/sbin/amavisd"' touch /var/lock/subsys/amavisd else msg_already_running Amavisd fi ;; stop) # Stop daemons. if [ -f /var/lock/subsys/amavisd ]; then msg_stopping Amavisd killproc amavisd; rm -f /var/lock/subsys/amavisd >/dev/null 2>&1 else msg_not_running Amavisd fi ;; status) status amavisd exit $? ;; restart|force-reload) $0 stop $0 start exit $? ;; *) msg_usage "$0 {start|stop|restart|force-reload|status}" exit 3 esac exit $RETVAL