summaryrefslogtreecommitdiffabout
path: root/init/debian
blob: 81f36da3be945d7dc9933a43583df0281c763aaa (plain)
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
#! /bin/sh
### BEGIN INIT INFO
# Provides:          varnish-mib
# Required-Start:    snmpd varnish
# Required-Stop:     snmpd varnish
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Manage varnish MIB agent
### END INIT INFO

# Source function library.
. /lib/lsb/init-functions

NAME=varnish-mib
DESC="varnish MIB agent"
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/varnish-mib
PIDFILE=/var/run/$NAME.pid
CONFIG=
OPTIONS=

test -x $DAEMON || exit 0

if [ -f /etc/default/$NAME ]; then
    . /etc/default/$NAME
fi

if [ -n "$CONFIG" ]; then
    OPTIONS="$OPTIONS -C -c$CONFIG"
fi

# Ensure we have a PATH
export PATH="${PATH:+$PATH:}/usr/sbin:/usr/bin:/sbin:/bin"

start() {
    log_daemon_msg "Starting $DESC" "$NAME"
    if start-stop-daemon --start --pidfile=$PIDFILE --quiet \
	                 --exec "$DAEMON" -- $OPTIONS -p $PIDFILE; then
	log_end_msg 0
    else
        log_end_msg 1
        exit 1
    fi
}
stop() {
    log_daemon_msg "Stopping $DESC" "$NAME"
    if start-stop-daemon --stop --pidfile=$PIDFILE --quiet \
	                 --retry 5 --exec $DAEMON; then
	log_end_msg 0
    else
        log_end_msg 1
    fi
}
restart() {
    stop
    sleep 1
    start
}
status() {
    status_of_proc -p $PIDFILE $DAEMON "$NAME"
}    
# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
        status && exit 0 || exit $?
	;;
  restart|force-reload)
	restart
	;;
  *)
	echo >&2 "Usage: $0 {start|stop|restart|force-reload|status|help}"
	exit 1
esac

Return to:

Send suggestions and report system problems to the System administrator.