Re: Looking for initd scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-07-28 08:50 +0200, Jan Willamowius wrote openh323gk-users:

Debian stable:

#! /bin/sh

### BEGIN INIT INFO
# Provides:          gnugk
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Should-Start:      $local_fs $network $named
# Should-Stop:       $local_fs $network $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start GnuGK
# Description:       Run the Gnu Gatekeeper daemon
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/gnugk
CONFIG=/etc/gatekeeper.ini
NAME=gnugk
DESC='H.323 gatekeeper'
ARGS="--config $CONFIG --output /var/log/gnugk/gnugk.log --pid /var/run/gnugk/gnugk.pid"

test -x $DAEMON -a -f $CONFIG|| exit 0
# we need to be able to run the daemon, eh ;)


ulimit -c unlimited
ulimit -d unlimited
ulimit -f unlimited
ulimit -n 999999
ulimit -v unlimited
ulimit -l unlimited

[ -f /etc/default/gnugk ]&&. /etc/default/gnugk
if [ "$START_ON_BOOT" != "yes" ]; then
	echo "$NAME : disabled in /etc/default/gnugk."
	exit 0
fi

if [ "$RESTART" != "yes" ]; then
	echo "$NAME restart: disabled in /etc/default/gnugk."
	exit 0
fi

if [ -n "$PARAMS" ]; then
	ARGS=" $PARAMS $ARGS "
fi

if [ ! -d "/var/run/$NAME" ]; then
    mkdir "/var/run/$NAME"
    chown gnugk.gnugk "/var/run/$NAME"
fi

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: "
	start-stop-daemon --start --quiet --nicelevel $NICE \
		--chuid $NAME --pidfile /var/run/$NAME/$NAME.pid \
		--background --exec $DAEMON -- $ARGS
	echo "$NAME."
	if [ -n "$REALTIME" ]; then
	sleep 3
	echo "Changing $NAME cheduler and priority."
	chrt -f -p $REALTIME `pidof gnugk`
	ulimit -a
	fi
	;;
  stop)
	echo -n "Stopping $DESC: "
		start-stop-daemon --stop --quiet \
		--pidfile /var/run/$NAME/$NAME.pid \
		--exec $DAEMON --oknodo
	echo "$NAME."
	;;
  reload)
	echo "Reloading $DESC configuration files."
	start-stop-daemon --stop --signal 1 --quiet --pidfile \
		/var/run/$NAME/$NAME.pid --exec $DAEMON
  ;;
  restart|force-reload)
	#
	#	If the "reload" option is implemented, move the "force-reload"
	#	option to the "reload" entry above. If not, "force-reload" is
	#	just the same as "restart".
	#
	$0 stop && $0 start
	;;
  *)
	N=/etc/init.d/$NAME
	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0


/etc/default/gnugk:

# Configuration of GnuGK:
# 
# Shall we launch GnuGK on bootup? (Needs to be "yes" or it won't start)
START_ON_BOOT=yes
RESTART=yes

# Additional params like debugging?
PARAMS="--core unlimited"
NICE=-20
#REALTIME=61 - only for -rt kernels


JW>Hi,
JW>
JW>to start GnuGk on Unix automatically when the server starts, one needs
JW>an initd script which is even different for most Linux distributions and
JW>the details of these scripts change rather frequently.
JW>
JW>GnuGk only ships a few example scripts (gk.initd.*) for distributions
JW>which are mostly outdated by now. I would like to collect new initd
JW>scripts from the community to include in the next release.
JW>
JW>If you have written an initd script, please mail it to me and please
JW>let me know which distribution is works on.
JW>
JW>Thanks!
JW>
JW>Jan
JW>
JW>

C уважением                       With Best Regards
Георгиевский Юрий.                Georgiewskiy Yuriy
+7 4872 711666                    +7 4872 711666
факс +7 4872 711143               fax +7 4872 711143
Компания ООО "Ай Ти Сервис"       IT Service Ltd
http://nkoort.ru                  http://nkoort.ru
JID: GHhost@xxxxxxxxxx            JID: GHhost@xxxxxxxxxx
YG129-RIPE                        YG129-RIPE
------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux