view sm-archive.rc @ 1:45c8592d5d13

initial version
author carl
date Fri, 10 Mar 2006 10:35:25 -0800
parents
children b8a3b366635a
line wrap: on
line source

#  -- bash header installed by automake --
#
# 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/sm-archive ]; then
            cd SYSCONFDIR   # conf file is here
            SBINDIR/sm-archive -d 10 -p local:/var/run/sm-archive/sm-archive.sock
            RETVAL=$?
            pid=`pidof -s SBINDIR/sm-archive`
            if [ $pid ]
            then
                success "Starting sm-archive milter:"
                touch /var/lock/subsys/sm-archive
                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 sm-archive
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sm-archive
        ;;
    restart|reload)
        $0 stop
        $0 start
        RETVAL=$?
        ;;
    status)
        status sm-archive
        RETVAL=$?
        ;;
    *)
        echo "Usage: sm-archive {start|stop|restart|status}"
        exit 1
esac
exit $RETVAL

# $Id$