summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-05-05 01:35:16 (GMT)
committerMartin Pitt <martin.pitt@ubuntu.com>2016-05-05 02:11:55 (GMT)
commit62d8aa9f53b81f63e01ec524559fb9b6ff33f4da (patch)
treefd298a2a164c25cd5c777a10ea7bfa355873cd3a
parent792434de9e80b80a8d19cd4b65bc8534b534e0ec (diff)
libnss-resolve: Enable systemd-resolved.service on package installation
This package makes little sense without resolved.
-rw-r--r--debian/changelog2
-rw-r--r--debian/libnss-resolve.postinst5
-rw-r--r--debian/libnss-resolve.postrm4
3 files changed, 11 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index a7701e1..257ff1e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,8 @@ systemd (229-6) UNRELEASED; urgency=medium
libnss-resolve already falls back to dns if resolved is not available.
This avoids querying failing DNS twice. Conversely, replace "resolv" with
"dns" in postrm.
+ * libnss-resolve: Enable systemd-resolved.service on package installation,
+ as this package makes little sense without resolved.
-- Martin Pitt <mpitt@debian.org> Tue, 26 Apr 2016 22:20:43 +0200
diff --git a/debian/libnss-resolve.postinst b/debian/libnss-resolve.postinst
index 0d1d430..141011b 100644
--- a/debian/libnss-resolve.postinst
+++ b/debian/libnss-resolve.postinst
@@ -38,6 +38,11 @@ if [ "$1" = configure ] && [ -z "$2" ]; then
# first install: setup the recommended configuration (unless
# nsswitch.conf already contains resolve entries)
insert_nss_entry
+ # ... and enable resolved
+ systemctl enable systemd-resolved.service
+ if [ -d /run/systemd/system ]; then
+ deb-systemd-invoke start systemd-resolved.service || true
+ fi
fi
#DEBHELPER#
diff --git a/debian/libnss-resolve.postrm b/debian/libnss-resolve.postrm
index e5e9510..67a742a 100644
--- a/debian/libnss-resolve.postrm
+++ b/debian/libnss-resolve.postrm
@@ -31,6 +31,10 @@ remove_nss_entry() {
if [ "$1" = remove ]; then
remove_nss_entry
+ systemctl disable systemd-resolved.service
+ if [ -d /run/systemd/system ]; then
+ deb-systemd-invoke stop systemd-resolved.service || true
+ fi
fi
#DEBHELPER#