aboutsummaryrefslogtreecommitdiff
path: root/init/debian
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-02-14 16:07:19 +0200
committerSergey Poznyakoff <gray@gnu.org>2019-02-14 16:10:39 +0200
commit2d2e9e1fdadb5af7bfd5a2a77500218b592034e1 (patch)
tree01aab262490eeff1dcea109767719ba1f84b50fc /init/debian
parentfe4dd5c7fe77591ee8d7780d3f5e2e9b9334c2c5 (diff)
downloadvarnish-mib-2d2e9e1fdadb5af7bfd5a2a77500218b592034e1.tar.gz
varnish-mib-2d2e9e1fdadb5af7bfd5a2a77500218b592034e1.tar.bz2
Version 4.0release-4.0
* Makefile.am: Add init. * NEWS: Update. * README: Mention initialization files from init. * configure.ac: Version 4.0 * init/README: New file. * init/debian: New file. * init/rh: New file. * init/slackware: New file. * init/slackware.genrc: New file. * init/varnish-mib.service: New file. * src/main.c: Minor fixes.
Diffstat (limited to 'init/debian')
-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
--- /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.