add init script to start firewall
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 15 Apr 2014 06:12:27 +0000 (08:12 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 15 Apr 2014 06:12:27 +0000 (08:12 +0200)
debian/pve-firewall.init [new file with mode: 0755]
debian/rules

diff --git a/debian/pve-firewall.init b/debian/pve-firewall.init
new file mode 100755 (executable)
index 0000000..5e01d1e
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:        pve-firewall
+# Required-Start:  $remote_fs $network pvefw-logger pve-cluster
+# Required-Stop:   $remote_fs $network pvefw-logger pve-cluster
+# Default-Start:   2 3 4 5
+# Default-Stop:    0 1 6
+# Short-Description: PVE firewall
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+PVEFW=/usr/sbin/pvefw
+NAME=pvefw
+DESC="PVE firewall"
+PIDFILE=/var/run/pvefw-logger.pid
+
+test -f $PVEFW || exit 0
+
+# avoid warnings about uninstalled locales
+export LC_ALL="C"
+
+case "$1" in
+       start)
+               log_daemon_msg "Starting $DESC" "$NAME"
+               $PVEFW start
+               log_end_msg $?
+               ;;
+       stop)
+               log_daemon_msg "Stopping $DESC" "$NAME"
+               $PVEFW stop
+               log_end_msg $?
+               ;;
+       reload|restart|force-reload)
+               log_daemon_msg "Restarting $DESC" "$NAME"
+               $PVEFW update
+               log_end_msg $?
+               ;;
+       *)
+               N=/etc/init.d/$NAME
+               echo "Usage: $N {start|stop|restart|force-reload}"
+               exit 1
+               ;;
+esac
+
+exit 0
index fadc499..92e01c0 100755 (executable)
@@ -6,6 +6,6 @@
 %:
        dh $@ 
 
-override_dh_auto_install:
-       dh_auto_install
+override_dh_installinit:
+       dh_installinit -R -p pve-firewall
        dh_installinit --name pvefw-logger