[Pkg-mpd-maintainers] Bug#670665: mpd: init script doesn't read mpd config if user is changed in it and fails to start mpd daemon
rush
rush1503 at gmail.com
Fri Apr 27 19:35:00 UTC 2012
Package: mpd
Version: 0.16.7-2
Severity: normal
Tags: patch
Dear Maintainer,
When user changes user in /etc/mpd.conf init script fails to start daemon, cause user mpd as owner of service directories is hardcoded in init script ( /etc/init.d/mpd).
Init script creates /var/run/mpd and its owner is mpd:audio (due to dpkg-statoverride, that's also wrong) and fails to create /var/run/mpd/pid, cause user specified in config hasn't enough permissions.
I modified init script and now ot seems find.
Here is diff:
================================================
24,27d23
< MPD_USER=$(sed -n '/^user/{s/.*"\([^"]*\)".*/\1/;p}' $MPDCONF)
< MPD_USER=${MPD_USER:-mpd}
< MPD_GROUP=$(sed -n '/^group/{s/.*"\([^"]*\)".*/\1/;p}' $MPDCONF)
< MPD_GROUP=${MPD_GROUP:-audio}
42,44c38,45
< #use defaults
< chown $MPD_USER:$MPD_GROUP /var/run/mpd
< chmod 755 /var/run/mpd
---
> if dpkg-statoverride --list --quiet /var/run/mpd > /dev/null; then
> #if dpkg-statoverride is used update it with permissions there
> dpkg-statoverride --force --quiet --update --add $( dpkg-statoverride --list --quiet /var/run/mpd ) 2> /dev/null
> else
> #use defaults
> chown mpd:audio /var/run/mpd
> chmod 755 /var/run/mpd
> fi
67c68
< chown $MPD_USER:$MPD_GROUP $PIDDIR
---
> chown mpd:audio $PIDDIR
==================================================
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages mpd depends on:
ii adduser 3.113+nmu1
ii libao4 1.1.0-1.1+b1
ii libasound2 1.0.25-2
ii libaudiofile1 0.3.3-3
ii libavahi-client3 0.6.31-1
ii libavahi-common3 0.6.31-1
ii libavahi-glib1 0.6.31-1
ii libavcodec53 5:0.10.2-0.3
ii libavformat53 5:0.10.2-0.3
ii libavutil51 5:0.10.2-0.3
ii libc6 2.13-30
ii libcurl3-gnutls 7.25.0-1
ii libfaad2 2.7-8
ii libflac8 1.2.1-6
ii libgcc1 1:4.7.0-4
ii libglib2.0-0 2.32.1-1
ii libid3tag0 0.15.1b-10
ii libjack-jackd2-0 [libjack-0.116] 1.9.8~dfsg.3+20120418gitf82ec715-4
ii libmad0 0.15.1b-7
ii libmikmod2 3.1.12-4
ii libmms0 0.6.2-3
ii libmp3lame0 1:3.99.5-0.1
ii libmpcdec6 2:0.1~r459-2
ii libogg0 1.2.2~dfsg-1
ii libpulse0 1.1-3+b1
ii libsamplerate0 0.1.8-4
ii libshout3 2.2.2-8
ii libsqlite3-0 3.7.11-2
ii libstdc++6 4.7.0-4
ii libvorbis0a 1.3.2-1.2
ii libvorbisenc2 1.3.2-1.2
ii libvorbisfile3 1.3.2-1.2
ii libwavpack1 4.60.1-3
ii lsb-base 4.1+Debian2
ii zlib1g 1:1.2.6.dfsg-2
mpd recommends no packages.
Versions of packages mpd suggests:
pn avahi-daemon <none>
pn icecast2 <none>
pn mpc [mpd-client] 0.20-2
pn mpdscribble [mpd-client] 0.22-2
pn ncmpcpp [mpd-client] 0.5.6-2
pn pulseaudio <none>
-- Configuration Files:
/etc/init.d/mpd changed [not included]
/etc/mpd.conf changed [not included]
-- no debconf information
More information about the Pkg-mpd-maintainers
mailing list