Package: mpd
Version: 0.13.2-3

Forwarding a patch from Ubuntu, mpd's init.d file should read the mpd
user from mpd.conf, instead of assuming the username is 'mpd'.
diff -pruN 0.13.2-2/debian/mpd.init.d 0.13.2-2ubuntu1/debian/mpd.init.d
--- 0.13.2-2/debian/mpd.init.d	2008-10-07 16:44:58.000000000 +0100
+++ 0.13.2-2ubuntu1/debian/mpd.init.d	2008-10-07 16:44:58.000000000 +0100
@@ -35,6 +35,7 @@ fi
 
 PIDFILE=$(sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF)
 DBFILE=$(sed -n 's/^[[:space:]]*db_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF)
+USER=`awk 'BEGIN{ao=0} /[ \t]*audio_output[ \t]*{/{ ao = 1 } /[ \t]*}/{ ao = 0 } /^[ \t]*user[ \t]*/{ if (ao == 0) user = $2 } END{ print substr(user, 2, length(user) - 2) }' $MPDCONF`
 
 mpd_start () {
     log_daemon_msg "Starting $DESC" "$NAME"
@@ -53,7 +54,7 @@ mpd_start () {
     PIDDIR=$(dirname "$PIDFILE")
     if [ ! -d "$PIDDIR" ]; then
         mkdir -m 0755 $PIDDIR
-        chown mpd:audio $PIDDIR
+        chown $USER:audio $PIDDIR
     fi
 
     if [ "$FORCE_CREATE_DB" -o ! -f "$DBFILE" ]; then

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to