[SCM] mpd-sima/master: init script ensure creation of /var/run/mpd-sima

kaliko-guest at users.alioth.debian.org kaliko-guest at users.alioth.debian.org
Wed Mar 6 23:44:11 UTC 2013


The following commit has been merged in the master branch:
commit 1d1303ad6f5fbe04ecc386f359fd4931ac711f7f
Author: Geoffroy Youri Berret <efrim at azylum.org>
Date:   Thu Mar 7 00:25:28 2013 +0100

    init script ensure creation of /var/run/mpd-sima
    
    cf. Debian policy 9.4.1
    http://www.debian.org/doc/debian-policy/ch-opersys.html#s-fhs-run

diff --git a/debian/mpd-sima.init b/debian/mpd-sima.init
index 896c196..b0f500d 100755
--- a/debian/mpd-sima.init
+++ b/debian/mpd-sima.init
@@ -41,6 +41,20 @@ DAEMON_ARGS="--daemon --var_dir=$VARDIR \
 # and status_of_proc is working.
 . /lib/lsb/init-functions
 
+# Ensure /var/run/mpd-sima is there, cf. Debian policy 9.4.1
+# http://www.debian.org/doc/debian-policy/ch-opersys.html#s-fhs-run
+if [ ! -d "$(dirname $PIDFILE)" ]; then
+    mkdir "$(dirname $PIDFILE)"
+    if dpkg-statoverride --list --quiet "$(dirname $PIDFILE)" > /dev/null; then
+        #if dpkg-statoverride is used update it with permissions there
+        dpkg-statoverride --force --quiet --update --add $( dpkg-statoverride --list --quiet "$(dirname $PIDFILE)" ) 2> /dev/null
+    else
+        #use defaults
+        chown $USER:$USER "$(dirname $PIDFILE)"
+        chmod 755 "$(dirname $PIDFILE)"
+    fi
+fi
+
 #
 # Function that starts the daemon/service
 #

-- 
mpd-sima packaging



More information about the pkg-multimedia-commits mailing list