Am 13.10.2016 um 17:56 schrieb Michael Biebl:
> Am 13.10.2016 um 17:47 schrieb Felipe Sateler:
>> On 13 October 2016 at 12:36, Michael Biebl <bi...@debian.org> wrote:
>>>
>>> Now that compat level 10 has --restart-after-upgrade as default, this
>>> bug has a wider impact (thus bumping the severity).
>>>
>>> With compat level 9 and older, --no-start did not generate any
>>> maintainer scripts code at all.
>>
>> You can get the same with dh 10 with --no-start --no-restart-after-upgrade
> 
> Right. But isn't this an unexpected change?
> See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=837528, which is
> related.
> I wonder if --no-start should imply --no-restart-after-upgrade
> 
> If not, we should at least improve the documentation in that regard.


fwiw, in network-manager I use

> override_dh_systemd_start:
>        dh_link lib/systemd/system/NetworkManager.service \
>                lib/systemd/system/network-manager.service
>        dh_systemd_start -pnetwork-manager --no-start 
> NetworkManager-dispatcher.service
>        dh_systemd_start -pnetwork-manager --no-start 
> NetworkManager-wait-online.service
>        dh_systemd_start -pnetwork-manager --restart-after-upgrade 
> NetworkManager.service

After the compat bump to 10, I get the attached diff, which shows many odd 
issues

postinst/
- NetworkManager-dispatcher.service is restarted 3 times, 
NetworkManager-wait-online.service 2 times
- we now process NetworkManager.service, although that should be handled by 
update-rc.d

postrm/,
- systemctl --system daemon-reload has been added 4 times

prerm/
- NetworkManager-dispatcher.service is stopped 3 times, 
NetworkManager-wait-online.service 2 times

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From be6b6122a9e8153956949460e3a4adabe01cc848 Mon Sep 17 00:00:00 2001
From: Michael Biebl <bi...@debian.org>
Date: Thu, 13 Oct 2016 17:59:24 +0200
Subject: [PATCH] dh 10

---
 debian/network-manager.postinst.debhelper | 89 +++++++++++++++++++++++++++++++
 debian/network-manager.postrm.debhelper   | 34 ++++++++++++
 debian/network-manager.prerm.debhelper    | 20 +++++++
 3 files changed, 143 insertions(+)

diff --git a/debian/network-manager.postinst.debhelper b/debian/network-manager.postinst.debhelper
index 8bdeb31..51c7a9f 100644
--- a/debian/network-manager.postinst.debhelper
+++ b/debian/network-manager.postinst.debhelper
@@ -1,3 +1,48 @@
+# Automatically added by dh_systemd_enable
+# This will only remove masks created by d-s-h on package removal.
+deb-systemd-helper unmask NetworkManager-dispatcher.service >/dev/null || true
+
+# was-enabled defaults to true, so new installations run enable.
+if deb-systemd-helper --quiet was-enabled NetworkManager-dispatcher.service; then
+	# Enables the unit on first installation, creates new
+	# symlinks on upgrades if the unit file has changed.
+	deb-systemd-helper enable NetworkManager-dispatcher.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 NetworkManager-dispatcher.service >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_enable
+# This will only remove masks created by d-s-h on package removal.
+deb-systemd-helper unmask NetworkManager-wait-online.service >/dev/null || true
+
+# was-enabled defaults to true, so new installations run enable.
+if deb-systemd-helper --quiet was-enabled NetworkManager-wait-online.service; then
+	# Enables the unit on first installation, creates new
+	# symlinks on upgrades if the unit file has changed.
+	deb-systemd-helper enable NetworkManager-wait-online.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 NetworkManager-wait-online.service >/dev/null || true
+fi
+# End automatically added section
+# Automatically added by dh_systemd_enable
+# This will only remove masks created by d-s-h on package removal.
+deb-systemd-helper unmask NetworkManager.service >/dev/null || true
+
+# was-enabled defaults to true, so new installations run enable.
+if deb-systemd-helper --quiet was-enabled NetworkManager.service; then
+	# Enables the unit on first installation, creates new
+	# symlinks on upgrades if the unit file has changed.
+	deb-systemd-helper enable NetworkManager.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 NetworkManager.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/network-manager" ]; then
@@ -11,3 +56,47 @@ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
 	fi
 fi
 # End automatically added section
+# 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 NetworkManager-dispatcher.service >/dev/null || true
+fi
+# End automatically added section
+# 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 NetworkManager-wait-online.service >/dev/null || true
+fi
+# End automatically added section
+# 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 NetworkManager-dispatcher.service >/dev/null || true
+fi
+# End automatically added section
+# 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 NetworkManager-dispatcher.service NetworkManager-wait-online.service >/dev/null || true
+fi
+# End automatically added section
diff --git a/debian/network-manager.postrm.debhelper b/debian/network-manager.postrm.debhelper
index 2f0d06b..c83b11c 100644
--- a/debian/network-manager.postrm.debhelper
+++ b/debian/network-manager.postrm.debhelper
@@ -1,3 +1,23 @@
+# 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_start
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+fi
+# End automatically added section
+# 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_start
+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 network-manager remove >/dev/null
@@ -10,3 +30,17 @@ 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 NetworkManager-dispatcher.service NetworkManager-wait-online.service NetworkManager.service >/dev/null
+	fi
+fi
+
+if [ "$1" = "purge" ]; then
+	if [ -x "/usr/bin/deb-systemd-helper" ]; then
+		deb-systemd-helper purge NetworkManager-dispatcher.service NetworkManager-wait-online.service NetworkManager.service >/dev/null
+		deb-systemd-helper unmask NetworkManager-dispatcher.service NetworkManager-wait-online.service NetworkManager.service >/dev/null
+	fi
+fi
+# End automatically added section
diff --git a/debian/network-manager.prerm.debhelper b/debian/network-manager.prerm.debhelper
index f74eb50..2d1d005 100644
--- a/debian/network-manager.prerm.debhelper
+++ b/debian/network-manager.prerm.debhelper
@@ -1,3 +1,23 @@
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+	deb-systemd-invoke stop NetworkManager-dispatcher.service NetworkManager-wait-online.service >/dev/null
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+	deb-systemd-invoke stop NetworkManager-dispatcher.service >/dev/null
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+	deb-systemd-invoke stop NetworkManager-wait-online.service >/dev/null
+fi
+# End automatically added section
+# Automatically added by dh_systemd_start
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+	deb-systemd-invoke stop NetworkManager-dispatcher.service >/dev/null
+fi
+# End automatically added section
 # Automatically added by dh_installinit
 if [ -x "/etc/init.d/network-manager" ] && [ "$1" = remove ]; then
 	invoke-rc.d network-manager stop || exit $?
-- 
2.9.3

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to