[sisyphus] dspam & chkconfig

Алексей Шенцев =?iso-8859-1?q?ashen_=CE=C1_nsrz=2Eru?=
Пн Авг 27 14:59:47 MSD 2007


В сообщении от Monday 27 August 2007 13:53:11 Pavlov Konstantin написал(а):
> Если Вы про сервис dspam, то в init-файле:
Да.

> # chkconfig: 345 90 10
> запустит на 3, 4 и 5.
Хм ... не въехал куда именно прописывать ...
вот такой старт/стоп скрипт:
-(ashen на oasu3)-(~/work/dspam)-> cat dspam.init
#!/bin/sh
#
# chkconfig: 2345 80 30
# description: dspam daemon

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

LOCKFILE=/var/lock/subsys/dspam
PIDFILE=/var/run/dspam.pid
RETVAL=0

start()
{
        action "Starting dspam service: " 
start-stop-daemon --quiet --start -b --pidfile 
$PIDFILE --exec /usr/bin/dspam -- --daemon
        RETVAL=$?
        return $RETVAL
}

stop()
{
        action "Stopping dspam service: " 
start-stop-daemon --stop --quiet --pidfile $PIDFILE dspam
        RETVAL=$?
        return $RETVAL
}

restart()
{
        stop
        sleep 1
        start
}

# See how we were called.
case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                restart
                ;;
        condstop)
                if [ -e "$LOCKFILE" ]; then
                        stop
                fi
                ;;
        condrestart)
                if [ -e "$LOCKFILE" ]; then
                        restart
                fi
                ;;
        status)
                #status dspam
                status --pidfile "$PIDFILE" --expect-user root -- dspam
                RETVAL=$?
                ;;
        *)
                echo "Usage: ${0##*/} {start|stop|reload|restart|condstop|
condrestart|status}"
                RETVAL=1
esac

exit $RETVAL
-(ashen на oasu3)-(~/work/dspam)->

И где, что прописывать?
-- 
С уважением Шенцев Алексей Владимирович.
E-mail: ashen на nsrz.ru
XMPP: ashen на altlinux.org, AlexShen на jabber.ru
ICQ: 271053845


Подробная информация о списке рассылки Sisyphus