add missing init.d file for pvefw-logger
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 14 Mar 2014 13:19:08 +0000 (14:19 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 14 Mar 2014 13:19:08 +0000 (14:19 +0100)
debian/pvefw-logger.init [new file with mode: 0755]

diff --git a/debian/pvefw-logger.init b/debian/pvefw-logger.init
new file mode 100755 (executable)
index 0000000..67367cc
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:        pvefw-logger
+# Required-Start:  $remote_fs $network $syslog pve-cluster cman clvm
+# Required-Stop:   $remote_fs $network $syslog pve-cluster cman clvm
+# Default-Start:   2 3 4 5
+# Default-Stop:    0 1 6
+# Short-Description: PVE firewall logger
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+DAEMON=/usr/sbin/pvefw-logger
+NAME=pvefw-logger
+DESC="PVE firewall logger"
+PIDFILE=/var/run/pvefw-logger.pid
+
+test -f $DAEMON || exit 0
+
+# avoid warnings about uninstalled locales
+export LC_ALL="C"
+
+case "$1" in
+       start)
+               log_daemon_msg "Starting $DESC" "$NAME"
+               start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
+               log_end_msg $?
+               ;;
+       stop)
+               log_daemon_msg "Stopping $DESC" "$NAME"
+               start-stop-daemon --stop --quiet --retry TERM/2/TERM/15/KILL/2 --pidfile $PIDFILE
+               log_end_msg $?
+               ;;
+       reload|restart|force-reload)
+               log_daemon_msg "Restarting $DESC" "$NAME"
+               start-stop-daemon --stop --quiet --retry TERM/2/TERM/15/KILL/2 --pidfile $PIDFILE
+               start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
+               log_end_msg $?
+               ;;
+       *)
+               N=/etc/init.d/$NAME
+               echo "Usage: $N {start|stop|restart|force-reload}"
+               exit 1
+               ;;
+esac
+
+exit 0