summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Metzler <ametzler@debian.org>2014-05-11 17:53:54 +0100
committerSimon Kelley <simon@thekelleys.org.uk>2014-05-11 17:53:54 +0100
commit62f992f06c5a1a7ed073a2f41ccaeeebb593cef6 (patch)
tree411e0cf2183f99ae592be8ff80663b69ced6e341
parenta23949d44d860cb98e82c22b94b5756fc43eccbb (diff)
downloaddnsmasq-62f992f06c5a1a7ed073a2f41ccaeeebb593cef6.tar.gz
Debian fix: Enable dnsmasq systemd unit on install.
-rw-r--r--debian/changelog11
-rw-r--r--debian/control6
-rw-r--r--debian/postinst16
-rw-r--r--debian/postrm16
4 files changed, 44 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 605a3f5..4bf739a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,14 @@
-dnsmasq (2.70-3) unstable; urgency=low
+dnsmasq (2.70-3) unstable; urgency=medium
* Write a pid-file, even when being started using systemd, since
other components may wish to signal dnsmasq.
-
- -- Simon Kelley <simon@thekelleys.org.uk> Fri, 09 May 2014 20:45:11 +0000
+ * Enable dnsmasq systemd unit on install. Otherwise dnsmasq does not run on
+ fresh installations (without administrator handholding) and even worse it
+ is disabled on systems switching from sysv to systemd. Modify
+ postinst/postrm exactly as dh_systemd would, add dependency on
+ init-system-helpers. Closes: #724602
+
+ -- Simon Kelley <simon@thekelleys.org.uk> Sun, 11 May 2014 17:45:21 +0000
dnsmasq (2.70-2) unstable; urgency=low
diff --git a/debian/control b/debian/control
index 80ede10..e7f2080 100644
--- a/debian/control
+++ b/debian/control
@@ -2,13 +2,15 @@ Source: dnsmasq
Section: net
Priority: optional
Build-depends: gettext, libnetfilter-conntrack-dev [linux-any],
- libidn11-dev, libdbus-1-dev (>=0.61), libgmp-dev, nettle-dev (>=2.4-3)
+ libidn11-dev, libdbus-1-dev (>=0.61), libgmp-dev,
+ nettle-dev (>=2.4-3)
Maintainer: Simon Kelley <simon@thekelleys.org.uk>
Standards-Version: 3.9.3
Package: dnsmasq
Architecture: all
-Depends: netbase, dnsmasq-base(>= ${binary:Version})
+Depends: netbase, dnsmasq-base(>= ${binary:Version}),
+ init-system-helpers (>= 1.18~)
Suggests: resolvconf
Conflicts: resolvconf (<<1.15)
Description: Small caching DNS proxy and DHCP/TFTP server
diff --git a/debian/postinst b/debian/postinst
index 98cd5e2..1d18c59 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -1,6 +1,22 @@
#!/bin/sh
set -e
+# Code copied from dh_systemd_enable ----------------------
+# This will only remove masks created by d-s-h on package removal.
+deb-systemd-helper unmask dnsmasq.service >/dev/null || true
+
+# was-enabled defaults to true, so new installations run enable.
+if deb-systemd-helper --quiet was-enabled dnsmasq.service; then
+ # Enables the unit on first installation, creates new
+ # symlinks on upgrades if the unit file has changed.
+ deb-systemd-helper enable dnsmasq.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 dnsmasq.service >/dev/null || true
+fi
+# End code copied from dh_systemd_enable ------------------
+
if [ -x /etc/init.d/dnsmasq ]; then
update-rc.d dnsmasq defaults 15 85 >/dev/null
diff --git a/debian/postrm b/debian/postrm
index 5e48921..8a45fd1 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -4,3 +4,19 @@ set -e
if [ purge = "$1" ]; then
update-rc.d dnsmasq remove >/dev/null
fi
+
+# Code copied from dh_systemd_enable ----------------------
+if [ "$1" = "remove" ]; then
+ if [ -x "/usr/bin/deb-systemd-helper" ]; then
+ deb-systemd-helper mask dnsmasq.service >/dev/null
+ fi
+fi
+
+if [ "$1" = "purge" ]; then
+ if [ -x "/usr/bin/deb-systemd-helper" ]; then
+ deb-systemd-helper purge dnsmasq.service >/dev/null
+ deb-systemd-helper unmask dnsmasq.service >/dev/null
+ fi
+fi
+# End code copied from dh_systemd_enable ------------------
+