[Pkg-mpd-maintainers] Bug#545559: Init script: Cannot _stop_ mpd when START_MPD is set to "false".
Sharon Kimble
boudiccas at talktalk.net
Sun Nov 25 19:39:31 UTC 2012
Package: mpd
Version: 0.16.7-2
Followup-For: Bug #545559
Dear Maintainer,
I came across this bug today on wheezy , and the only solution I found is to
amend /etc/default/mpd and amend # MPDCONF=/etc/mpd.conf and uncomment it and
amend it to MPDCONF=/home/boztu/.mpd/mpd.conf to my local conf file for it.
Then I was able to sudo service mpd stop knowing that mpd would restart and use
my local conf file. In this way I'm able to run mpd as a $USER.
Thank you
Sharon Kimble.
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 3.2.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages mpd depends on:
ii adduser 3.113+nmu3
ii libao4 1.1.0-2
ii libasound2 1.0.25-4
ii libaudiofile1 0.3.4-2
ii libavahi-client3 0.6.31-1
ii libavahi-common3 0.6.31-1
ii libavahi-glib1 0.6.31-1
ii libavcodec53 6:0.8.4-1
ii libavformat53 [libavformat-extra-53] 6:0.8.4-1
ii libavutil51 [libavutil-extra-51] 6:0.8.4-1
ii libc6 2.13-35
ii libcurl3-gnutls 7.26.0-1
ii libfaad2 2.7-8
ii libflac8 1.2.1-6
ii libgcc1 1:4.7.2-4
ii libglib2.0-0 2.33.12+really2.32.4-3
ii libid3tag0 0.15.1b-10
ii libjack-jackd2-0 [libjack-0.116] 1.9.8~dfsg.4+20120529git007cdc37-4.1
ii libmad0 0.15.1b-7
ii libmikmod2 3.1.12-4.1
ii libmms0 0.6.2-3
ii libmp3lame0 3.99.5+repack1-3
ii libmpcdec6 2:0.1~r459-4
ii libogg0 1.3.0-4
ii libpulse0 2.0-6
ii libsamplerate0 0.1.8-5
ii libshout3 2.2.2-8
ii libsqlite3-0 3.7.13-1
ii libstdc++6 4.7.2-4
ii libvorbis0a 1.3.2-1.3
ii libvorbisenc2 1.3.2-1.3
ii libvorbisfile3 1.3.2-1.3
ii libwavpack1 4.60.1-3
ii lsb-base 4.1+Debian8
ii zlib1g 1:1.2.7.dfsg-13
mpd recommends no packages.
Versions of packages mpd suggests:
ii avahi-daemon 0.6.31-1
pn icecast2 <none>
ii pulseaudio 2.0-6
ii sonata [mpd-client] 1.6.2.1-5
-- Configuration Files:
/etc/default/mpd changed:
START_MPD=true
MPDCONF=/home/boztu/.mpd/mpd.conf
/etc/init.d/mpd changed:
.. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=mpd
DESC="Music Player Daemon"
DAEMON=/usr/bin/mpd
MPDCONF=/etc/mpd.conf
START_MPD=false
[ -x "$DAEMON" ] || exit 0
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
if [ -n "$MPD_DEBUG" ]; then
set -x
MPD_OPTS=--verbose
fi
if [ ! -d "/var/run/mpd" ]; then
mkdir /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
fi
DBFILE=$(sed -n 's/^[[:space:]]*db_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF)
PIDFILE=$(sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF)
mpd_start () {
if [ "$START_MPD" != "true" ]; then
log_action_msg "Not starting MPD: disabled by /etc/default/$NAME".
exit 0
fi
log_daemon_msg "Starting $DESC" "$NAME"
if [ -z "$PIDFILE" -o -z "$DBFILE" ]; then
log_failure_msg \
"$MPDCONF must have db_file and pid_file set; cannot start daemon."
exit 1
fi
PIDDIR=$(dirname "$PIDFILE")
if [ ! -d "$PIDDIR" ]; then
mkdir -m 0755 $PIDDIR
chown mpd:audio $PIDDIR
fi
start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" \
--exec "$DAEMON" -- $MPD_OPTS "$MPDCONF"
log_end_msg $?
}
mpd_stop () {
if [ "$START_MPD" != "true" ]; then
log_failure_msg "Not stopping MPD: disabled by /etc/default/$NAME".
exit 0
fi
if [ -z "$PIDFILE" ]; then
log_failure_msg \
"$MPDCONF must have pid_file set; cannot stop daemon."
exit 1
fi
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet --oknodo --retry 5 --pidfile "$PIDFILE" \
--exec $DAEMON
log_end_msg $?
}
case "$1" in
start)
mpd_start
;;
stop)
mpd_stop
;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME
;;
restart|force-reload)
mpd_stop
mpd_start
;;
force-start)
mpd_start
;;
force-restart)
mpd_stop
mpd_start
;;
force-reload)
mpd_stop
mpd_start
;;
*)
echo "Usage: $0 {start|start-create-db|stop|restart|force-reload}"
exit 2
;;
esac
/etc/mpd.conf changed:
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/tag_cache"
log_file "/var/log/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "boztu"
bind_to_address "localhost"
input {
plugin "curl"
}
audio_output {
type "alsa"
name "My ALSA Device"
device "hw:0,0" # optional
format "44100:16:2" # optional
mixer_device "default" # optional
mixer_control "PCM" # optional
mixer_index "0" # optional
}
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
-- no debconf information
More information about the Pkg-mpd-maintainers
mailing list