[pve-devel] [PATCH firewall 2/6] debian: drop init scripts
Fabian Grünbichler
f.gruenbichler at proxmox.com
Thu Mar 8 13:33:52 CET 2018
and switch to plain dh_systemd_*
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
debian/pve-firewall.init | 68 ------------------------------------------------
debian/pvefw-logger.init | 50 -----------------------------------
debian/rules | 10 +++++--
3 files changed, 8 insertions(+), 120 deletions(-)
delete mode 100755 debian/pve-firewall.init
delete mode 100755 debian/pvefw-logger.init
diff --git a/debian/pve-firewall.init b/debian/pve-firewall.init
deleted file mode 100755
index 062dfa4..0000000
--- a/debian/pve-firewall.init
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/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: Proxmox VE firewall
-### END INIT INFO
-
-. /lib/lsb/init-functions
-
-PATH=/sbin:/bin:/usr/bin:/usr/sbin
-NAME=pve-firewall
-DAEMON=/usr/sbin/$NAME
-DESC="Proxmox VE firewall"
-PIDFILE=/var/run/$NAME.pid
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-[ -e /proxmox_install_mode ] && exit 0
-
-START_FIREWALL=yes
-
-# Read configuration variable file if it is present
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-[ "$START_FIREWALL" = "yes" ] || exit 0
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
-# and status_of_proc is working.
-. /lib/lsb/init-functions
-
-# avoid warnings about uninstalled locales
-export LC_ALL="C"
-
-case "$1" in
- start)
- log_daemon_msg "Starting $DESC" "$NAME"
- $DAEMON start
- log_end_msg $?
- ;;
- stop)
- log_daemon_msg "Stopping $DESC" "$NAME"
- $DAEMON stop
- log_end_msg $?
- ;;
- status)
- $DAEMON status
- ;;
- reload|restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- $DAEMON restart
- log_end_msg $?
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|status|restart|force-reload}"
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/debian/pvefw-logger.init b/debian/pvefw-logger.init
deleted file mode 100755
index f2908ef..0000000
--- a/debian/pvefw-logger.init
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-### BEGIN INIT INFO
-# Provides: pvefw-logger
-# Required-Start: $remote_fs $network $syslog pve-cluster
-# Required-Stop: $remote_fs $network $syslog pve-cluster
-# 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
-[ -e /proxmox_install_mode ] && 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
diff --git a/debian/rules b/debian/rules
index 4a03d64..13b11d7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,6 +6,12 @@
%:
dh $@ --with systemd
+override_dh_systemd_enable:
+ dh_systemd_enable --name pvefw-logger pve-fwlogger.service
+ dh_systemd_enable --name pve-firewall pve-firewall.service
+
+override_dh_systemd_start:
+ dh_systemd_start --restart-after-upgrade pvefw-logger.service
+ # pve-firewall start/try-reload-restart manually in postinst
+
override_dh_installinit:
- dh_installinit -R --name pvefw-logger
- dh_installinit -p pve-firewall --no-restart-on-upgrade
--
2.14.2
More information about the pve-devel
mailing list