ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] init.d
@ 2005-05-14  6:54 Anton Gorlov
  2005-05-14  7:08 ` [Comm] init.d Michael Shigorin
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Gorlov @ 2005-05-14  6:54 UTC (permalink / raw)
  To: community

Здравствуйте, community.

Что скажут ГУРУ по поводу приведённого ниже скрипта? В частностии
интерисует -придётся ли его перепиливать под ALT или он и так взлетит?

#!/bin/sh
# Startup script for IBS
#
# chkconfig: 2345 95 05
# description: Run/Shutdown Isp Billing System

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

prog="ibs.py"
ibs_check="ibs_check.py"
ibs_root="/usr/local/ibs"
export LD_ASSUME_KERNEL=2.4.1 #prevent python deadlocks

startibs_check() {
    echo "Starting IBS Checker process:"
    daemon $ibs_root/sc/$ibs_check
    RETVAL=$?
    echo
    return $RETVAL
}

startibs() {
    echo -n $"Starting IBS Core: " 
    /sbin/modprobe sch_tbf >/dev/null 2>&1
    daemon -1 $ibs_root/$prog
    echo
    return $RETVAL
}

stop() {
    echo -n $"Stopping $prog: "
    /usr/bin/killall $prog
    RETVAL=$?
    c=0
    while [ \( "`ps x|grep ibs.py|grep -v grep`" != "" \) -a \( $c -lt 20 \) ]; do
        sleep 1
        echo -n "."
        c=$((c+1))
    done
    /usr/bin/killall -9 ibs.py >/dev/null 2>&1
    /usr/bin/killall ibs_check.py
    if [ $RETVAL = 0 ]; then
        success
    else
        failure
    fi
    echo 
    return $RETVAL
}

case "$1" in
        start)
            startibs
            startibs_check
            ;;
        
        stop)
            stop
            ;;
        
        status)
            status $prog
            ;;
        restart)
            stop
            sleep 1
            startibs
            startibs_check
            ;;
        
        startibs)
            startibs
            ;;

        *)
            echo $"Usage: $0 {start|startibs|stop|restart|status}"
            exit 1

esac

exit 0



-- 
С уважением,
 Anton                          mailto:Pnz.Stalker@mail.ru
                                     FIDO: 2:5059/37



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-14 15:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-14  6:54 [Comm] init.d Anton Gorlov
2005-05-14  7:08 ` [Comm] init.d Michael Shigorin
2005-05-14  7:09   ` Anton Gorlov
2005-05-14 15:53     ` Michael Shigorin

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git