[pve-devel] [PATCH firewall 0/6] pve-firewall packaging cleanup

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Mar 8 13:33:50 CET 2018


various small fixes, and a solution for #1319

relevant diff of binary package:

 ── control file list
  @@ -1,9 +1,8 @@
   drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./
  --rw-r--r--   0 root         (0) root         (0)      106 2017-12-07 07:31:42.000000 ./conffiles
  +-rw-r--r--   0 root         (0) root         (0)       30 2017-12-07 07:31:42.000000 ./conffiles
   -rw-r--r--   0 root         (0) root         (0)      467 2017-12-07 07:31:42.000000 ./control
   -rw-r--r--   0 root         (0) root         (0)     1765 2017-12-07 07:31:42.000000 ./md5sums
  --rwxr-xr-x   0 root         (0) root         (0)     1756 2017-12-07 07:31:42.000000 ./postinst
  --rwxr-xr-x   0 root         (0) root         (0)     1131 2017-12-07 07:31:42.000000 ./postrm
  --rwxr-xr-x   0 root         (0) root         (0)      423 2017-12-07 07:31:42.000000 ./preinst
  --rwxr-xr-x   0 root         (0) root         (0)      383 2017-12-07 07:31:42.000000 ./prerm
  +-rwxr-xr-x   0 root         (0) root         (0)     1511 2017-12-07 07:31:42.000000 ./postinst
  +-rwxr-xr-x   0 root         (0) root         (0)      605 2017-12-07 07:31:42.000000 ./postrm
  +-rwxr-xr-x   0 root         (0) root         (0)      210 2017-12-07 07:31:42.000000 ./prerm
   -rw-r--r--   0 root         (0) root         (0)       33 2017-12-07 07:31:42.000000 ./triggers
 ── ./conffiles
  @@ -1,4 +1 @@
  -/etc/default/pve-firewall
  -/etc/init.d/pve-firewall
  -/etc/init.d/pvefw-logger
   /etc/logrotate.d/pve-firewall
 ── ./postinst
  @@ -1,27 +1,11 @@
   #!/bin/sh
   
   set -e
   
  -case "$1" in
  -    configure)
  -	# Remove masks created by dh_systemd_enable on package removal.
  -	deb-systemd-helper unmask pve-firewall.service >/dev/null || true
  -	systemctl reload-or-restart pve-firewall
  -    ;;
  -
  -    abort-upgrade|abort-remove|abort-deconfigure)
  -    ;;
  -
  -    *)
  -        echo "postinst called with unknown argument \`$1'" >&2
  -        exit 1
  -    ;;
  -esac
  -
   # Automatically added by dh_systemd_enable
   # This will only remove masks created by d-s-h on package removal.
   deb-systemd-helper unmask pve-firewall.service >/dev/null || true
   
   # was-enabled defaults to true, so new installations run enable.
   if deb-systemd-helper --quiet was-enabled pve-firewall.service; then
   	# Enables the unit on first installation, creates new
  @@ -29,31 +13,42 @@
   	deb-systemd-helper enable pve-firewall.service >/dev/null || true
   else
   	# Update the statefile to add new symlinks (if any), which need to be
   	# cleaned up on purge. Also remove old symlinks.
   	deb-systemd-helper update-state pve-firewall.service >/dev/null || true
   fi
   # End automatically added section
  -# Automatically added by dh_installinit
  -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
  -	if [ -x "/etc/init.d/pvefw-logger" ]; then
  -		update-rc.d pvefw-logger defaults >/dev/null
  -		if [ -n "$2" ]; then
  -			_dh_action=restart
  -		else
  -			_dh_action=start
  -		fi
  -		invoke-rc.d pvefw-logger $_dh_action || exit $?
  +# Automatically added by dh_systemd_start
  +if [ -d /run/systemd/system ]; then
  +	systemctl --system daemon-reload >/dev/null || true
  +	if [ -n "$2" ]; then
  +		_dh_action=try-restart
  +	else
  +		_dh_action=start
   	fi
  +	deb-systemd-invoke $_dh_action pvefw-logger.service >/dev/null || true
   fi
   # End automatically added section
  -# Automatically added by dh_installinit
  -if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
  -	if [ -x "/etc/init.d/pve-firewall" ]; then
  -		update-rc.d pve-firewall defaults >/dev/null
  -		invoke-rc.d pve-firewall start || exit $?
  +
  +
  +case "$1" in
  +    configure)
  +	# modeled after dh_systemd_start output
  +	systemctl --system daemon-reload >/dev/null || true
  +	if [ -n "$2" ]; then
  +		_dh_action=try-reload-or-restart
  +	else
  +		_dh_action=start
   	fi
  -fi
  -# End automatically added section
  +	deb-systemd-invoke $_dh_action pve-firewall.service >/dev/null || true
  +    ;;
  +
  +    abort-upgrade|abort-remove|abort-deconfigure)
  +    ;;
   
  +    *)
  +        echo "postinst called with unknown argument \`$1'" >&2
  +        exit 1
  +    ;;
  +esac
   
   exit 0
 ── ./postrm
  @@ -1,30 +1,11 @@
   #!/bin/sh
   set -e
  -# Automatically added by dh_installinit
  -if [ "$1" = "purge" ] ; then
  -	update-rc.d pve-firewall remove >/dev/null
  -fi
  -
  -
  -# In case this system is running systemd, we make systemd reload the unit files
  -# to pick up changes.
  -if [ -d /run/systemd/system ] ; then
  -	systemctl --system daemon-reload >/dev/null || true
  -fi
  -# End automatically added section
  -# Automatically added by dh_installinit
  -if [ "$1" = "purge" ] ; then
  -	update-rc.d pvefw-logger remove >/dev/null
  -fi
  -
  -
  -# In case this system is running systemd, we make systemd reload the unit files
  -# to pick up changes.
  -if [ -d /run/systemd/system ] ; then
  +# Automatically added by dh_systemd_start
  +if [ -d /run/systemd/system ]; then
   	systemctl --system daemon-reload >/dev/null || true
   fi
   # End automatically added section
   # Automatically added by dh_systemd_enable
   if [ "$1" = "remove" ]; then
   	if [ -x "/usr/bin/deb-systemd-helper" ]; then
   		deb-systemd-helper mask pve-firewall.service >/dev/null
 ── ./prerm
  @@ -1,12 +1,7 @@
   #!/bin/sh
   set -e
  -# Automatically added by dh_installinit
  -if [ -x "/etc/init.d/pve-firewall" ] && [ "$1" = remove ]; then
  -	invoke-rc.d pve-firewall stop || exit $?
  -fi
  -# End automatically added section
  -# Automatically added by dh_installinit
  -if [ -x "/etc/init.d/pvefw-logger" ] && [ "$1" = remove ]; then
  -	invoke-rc.d pvefw-logger stop || exit $?
  +# Automatically added by dh_systemd_start
  +if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
  +	deb-systemd-invoke stop pvefw-logger.service >/dev/null
   fi
   # End automatically added section
 ── file list
  @@ -1,14 +1,9 @@
   drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./
   drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./etc/
  -drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./etc/default/
  --rw-r--r--   0 root         (0) root         (0)       85 2017-12-07 07:31:42.000000 ./etc/default/pve-firewall
  -drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./etc/init.d/
  --rwxr-xr-x   0 root         (0) root         (0)     1479 2017-12-07 07:31:42.000000 ./etc/init.d/pve-firewall
  --rwxr-xr-x   0 root         (0) root         (0)     1285 2017-12-07 07:31:42.000000 ./etc/init.d/pvefw-logger
   drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./etc/logrotate.d/
   -rw-r--r--   0 root         (0) root         (0)      250 2017-12-07 07:31:42.000000 ./etc/logrotate.d/pve-firewall
   drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./lib/
   drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./lib/systemd/
   drwxr-xr-x   0 root         (0) root         (0)        0 2017-12-07 07:31:42.000000 ./lib/systemd/system/
   -rw-r--r--   0 root         (0) root         (0)      506 2017-12-07 07:31:42.000000 ./lib/systemd/system/pve-firewall.service
   -rw-r--r--   0 root         (0) root         (0)      293 2017-12-07 07:31:42.000000 ./lib/systemd/system/pvefw-logger.service

Fabian Grünbichler (6):
  fix #1319: don't fail postinst with masked service
  debian: drop init scripts
  debian: switch to compat 9
  debian: drop preinst
  debian: remove duplicate dh_systemd_enable code
  build: use git rev-parse for GITVERSION

 Makefile                 |  2 +-
 debian/compat            |  2 +-
 debian/postinst          | 15 +++++++----
 debian/preinst           | 27 -------------------
 debian/pve-firewall.init | 68 ------------------------------------------------
 debian/pvefw-logger.init | 50 -----------------------------------
 debian/rules             | 10 +++++--
 7 files changed, 20 insertions(+), 154 deletions(-)
 delete mode 100644 debian/preinst
 delete mode 100755 debian/pve-firewall.init
 delete mode 100755 debian/pvefw-logger.init

-- 
2.14.2





More information about the pve-devel mailing list