view sm-archive.rc @ 5:b8a3b366635a

initial version
author carl
date Fri, 10 Mar 2006 12:06:40 -0800
parents 45c8592d5d13
children 0b03e7656abf
line wrap: on
line source

#  -- bash header installed by automake --
#
# smarchive   This script controls the smarchive milter daemon.
#
#
# chkconfig: 2345 79 31
# description: smarchive allows adding recipients to mail passing thru this milter
# processname: smarchive
# pidfile: /var/run/smarchive.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 smarchive-milter: "
        if [ ! -f /var/lock/subsys/smarchive ]; then
            cd SYSCONFDIR/sm-archive    # conf file is here
            SBINDIR/smarchive -d 10 -p local:/var/run/smarchive/smarchive.sock
            RETVAL=$?
            pid=`pidof -s SBINDIR/smarchive`
            if [ $pid ]
            then
                success "Starting smarchive milter:"
                touch /var/lock/subsys/smarchive
                echo
            else
                failure "Starting smarchive milter:"
                echo
            fi
        else
            echo -n "already running! "
            failure "smarchive milter already running!"
            echo
        fi

        ;;
    stop)
        # Stop daemons.
        echo -n "Shutting down smarchive-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: smarchive {start|stop|restart|status}"
        exit 1
esac
exit $RETVAL

# $Id$