File: init

package info (click to toggle)
npd6 1.1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 296 kB
  • sloc: ansic: 2,393; sh: 94; makefile: 80
file content (82 lines) | stat: -rwxr-xr-x 2,264 bytes parent folder | download | duplicates (4)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#! /bin/sh
### BEGIN INIT INFO
# Provides:          npd6
# Required-Start:    $remote_fs $syslog $network
# Required-Stop:     $remote_fs $syslog	$network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Description: Provides the npd6 daemon.
# Short-Description: Provides the npd6 daemon.
### END INIT INFO

# Author: Sean Groarke, sgroarke@gmail.com>
# $HeadURL$
# $Id$

# Do NOT "set -e"

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="npd6 - Neighbor proxy Daemon IPv6"
NAME=npd6
DAEMON=/usr/bin/$NAME
# Check man page or --help to get more optional arguments
#DAEMON_ARGS="--debug -l /var/log/npd6.log"
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

do_reload() {
	#
	# If the daemon can reload its configuration without
	# restarting (for example, when it is sent a SIGHUP),
	# then implement that here.
	#
	log_daemon_msg "Doing a daemon reload - USR1"
	start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE --name $NAME
	return 0
}

case "$1" in
  start)
	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
	#do_start
	start-stop-daemon --start --exec $DAEMON -- $DAEMON_ARGS
	case "$?" in
		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
	esac
	;;
  stop)
	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
	#do_stop
	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
	case "$?" in
		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
	esac
	;;
  status)
       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
       ;;
  restart|force-reload)
	log_daemon_msg "Restarting $DESC" "$NAME"
        start-stop-daemon --stop --retry=TERM/30/KILL/5 --exec $DAEMON
        start-stop-daemon --start --exec $DAEMON -- $DAEMON_ARGS 
	;;
  *)
	echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
	exit 3
	;;
esac

: