File: init.d

package info (click to toggle)
dancer-ircd 1.0.36-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 3,204 kB
  • ctags: 2,703
  • sloc: ansic: 36,121; sh: 3,534; perl: 612; makefile: 307
file content (60 lines) | stat: -rw-r--r-- 1,337 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/sh

### BEGIN INIT INFO
# Provides:          dancer-ircd
# 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: Dancer-IRCd daemon init.d script
# Description:       Use to manage the Dancer-IRCd daemon.
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/dancer-ircd
NAME=dancer-ircd
DESC=dancer-ircd

test -f $DAEMON || exit 0

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: "
	start-stop-daemon --start --quiet --chuid dancer \
		--pidfile /var/run/dancer-ircd/$NAME.pid \
		--exec $DAEMON -- -d /
	echo "$NAME."
	;;
  stop)
	echo -n "Stopping $DESC: "
	start-stop-daemon --stop --quiet --oknodo \
		--pidfile /var/run/dancer-ircd/$NAME.pid \
		--exec $DAEMON
	rm -f /var/run/dancer-ircd/$NAME.pid
	echo "$NAME."
	;;
  reload|force-reload)
	echo "Reloading $DESC configuration files."
	start-stop-daemon --stop --quiet --signal 1 --oknodo \
		--pidfile /var/run/dancer-ircd/$NAME.pid \
		--exec $DAEMON
  ;;
  restart)
	echo -n "Restarting $DESC: "
        $0 stop
	sleep 1
        $0 start
	echo "$NAME."
	;;
  *)
	N=/etc/init.d/$NAME
	echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	exit 1
	;;
esac

exit 0