Mercurial > sm-archive
diff sm-archive.rc.in @ 17:8ebecad6530f stable-1-6
Add src/daemon* missing from source control.
Switch to Mercurial source control.
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 21 Mar 2008 16:00:13 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sm-archive.rc.in Fri Mar 21 16:00:13 2008 -0700 @@ -0,0 +1,65 @@ +#!@BASH@ +# +# sm-archive This script controls the sm-archive milter daemon. +# +# +# chkconfig: 2345 79 31 +# description: sm-archive allows adding recipients to mail passing thru this milter +# processname: sm-archive +# pidfile: /var/run/sm-archive.pid +# Source function library. +# +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +RETVAL=0 +# See how we were called. +case "$1" in + start) + # Start daemons. + echo -n "Starting sm-archive-milter: " + if [ ! -f /var/lock/subsys/smarchive ]; then + cd SYSCONFDIR/sm-archive # conf file is here + SBINDIR/smarchive -d 10 -p local:/var/run/sm-archive/sm-archive.sock + RETVAL=$? + pid=`pidof -s SBINDIR/smarchive` + if [ $pid ] + then + success "Starting sm-archive milter:" + touch /var/lock/subsys/smarchive + echo + else + failure "Starting sm-archive milter:" + echo + fi + else + echo -n "already running! " + failure "sm-archive milter already running!" + echo + fi + + ;; + stop) + # Stop daemons. + echo -n "Shutting down sm-archive-milter: " + killproc smarchive + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/smarchive + ;; + restart|reload) + $0 stop + $0 start + RETVAL=$? + ;; + status) + status smarchive + RETVAL=$? + ;; + *) + echo "Usage: sm-archive {start|stop|restart|status}" + exit 1 +esac +exit $RETVAL