[Pkg-mpd-commits] [pkg-mpd] 10/13: disable mpd for (new) systemd units if START_MPD was not true

Florian Schlichting fsfs at moszumanska.debian.org
Sat Mar 21 00:29:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

fsfs pushed a commit to branch master
in repository pkg-mpd.

commit fdeabc57156011bb2668f8a50660539c0990d337
Author: Florian Schlichting <fsfs at debian.org>
Date:   Sat Mar 21 01:10:57 2015 +0100

    disable mpd for (new) systemd units if START_MPD was not true
---
 debian/mpd.postinst | 6 ++++++
 debian/mpd.preinst  | 1 +
 2 files changed, 7 insertions(+)

diff --git a/debian/mpd.postinst b/debian/mpd.postinst
index 207ac32..dd4c349 100644
--- a/debian/mpd.postinst
+++ b/debian/mpd.postinst
@@ -28,4 +28,10 @@ if [ "$ACTION" = "configure" ]; then
     fi
 fi
 
+# disable mpd for (new) systemd units if START_MPD was not true
+if [ -f /var/lib/mpd/NO_START ]; then
+    rm /var/lib/mpd/NO_START
+    deb-systemd-helper update-state mpd.socket mpd.service
+fi
+
 #DEBHELPER#
diff --git a/debian/mpd.preinst b/debian/mpd.preinst
index ee1d0c9..101c0a6 100644
--- a/debian/mpd.preinst
+++ b/debian/mpd.preinst
@@ -10,6 +10,7 @@ VERSION="$2"
 if [ "$ACTION" = "upgrade" ]; then
     [ -r /etc/default/mpd ] && . /etc/default/mpd
     if grep -q START_MPD /etc/default/mpd && [ "x$START_MPD" != "xtrue" ]; then
+        touch /var/lib/mpd/NO_START
         update-rc.d mpd disable > /dev/null
         # attempt to reset /etc/default/mpd to unmodified state
         sed -i -e's/^START_MPD=.*$/START_MPD=true/' /etc/default/mpd

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/pkg-mpd.git



More information about the Pkg-mpd-commits mailing list