#
# ngIRCd start and stop script for Debian-based systems
#
-# $Id: ngircd.init,v 1.1 2003/12/31 17:20:11 alex Exp $
+# $Id: ngircd.init,v 1.7 2006/12/26 14:43:46 alex Exp $
#
+### BEGIN INIT INFO
+# Provides: ircd
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Should-Start: $syslog $network
+# Should-Stop: $syslog $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Next Generation IRC Server
+### END INIT INFO
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/ngircd
NAME=ngIRCd
DESC="IRC daemon"
PARAMS=""
-test -x $DAEMON || exit 0
+test -h "$0" && me=`readlink $0` || me="$0"
+BASENAME=`basename $me`
-test -f /etc/default/ngircd && . /etc/default/ngircd
+test -f /etc/default/$BASENAME && . /etc/default/$BASENAME
+
+test -x $DAEMON || exit 0
Check_Config()
{
Try_Start()
{
+ [ ! -d /var/run/ircd ] || chown irc:irc /var/run/ircd
start-stop-daemon --start --quiet --exec $DAEMON -- $PARAMS
if [ $? -ne 0 ]; then
echo "$NAME failed!"
;;
stop)
echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON \
+ start-stop-daemon --stop --quiet --pidfile /var/run/ircd/ngircd.pid --exec $DAEMON \
&& echo "$NAME." \
|| echo "(none running)"
;;