summaryrefslogtreecommitdiffabout
path: root/init/debian
Side-by-side diff
Diffstat (limited to 'init/debian') (more/less context) (ignore whitespace changes)
-rwxr-xr-xinit/debian79
1 files changed, 79 insertions, 0 deletions
diff --git a/init/debian b/init/debian
new file mode 100755
index 0000000..81f36da
--- a/dev/null
+++ b/init/debian
@@ -0,0 +1,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.