FS#6129 - mpd script should use mpd --kill

Attached to Project: Arch Linux
Opened by Scott H (stonecrest) - Monday, 01 January 2007, 20:22 GMT
Last edited by Roman Kyrylych (Romashka) - Saturday, 14 April 2007, 09:35 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Damir Perisa (damir.perisa)
Architecture All
Severity Low
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently the /etc/rc.d/mpd script uses:
[ ! -z "$PID" ] && kill $PID &> /dev/null

However, this doesn't properly shutdown mpd (for example, mpd won't update the mpdstate file on exit!). This should really be changed to:
[ ! -z "$PID" ] && /usr/bin/mpd --kill &> /dev/null

The only side effect of doing this is that the pid_file variable needs to be uncommented for mpd --kill to work, so you'll probably want to grep+sed it.
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Saturday, 14 April 2007, 09:35 GMT
Reason for closing:  Fixed
Comment by Damir Perisa (damir.perisa) - Monday, 01 January 2007, 23:58 GMT
how does this apply to multiple instances of mpd running? what would a simple

"mpd --kill"

do in such a case?

killing daemons should be pID specific - i agree that oen should use the "proper" shutdown way of mpd
Comment by Scott H (stonecrest) - Tuesday, 02 January 2007, 00:58 GMT
I'm not entirely sure I understand your question. You can't start multiple instances of mpd from the /etc/rc.d script, so if the user is doing this manually, they need to be stopping them manually too (i.e. mpd /etc/mpd2.conf; mpd --kill /etc/mpd2.conf). For multiple instances of mpd, there should be multiple config files, each with its own pid_file variable.

This makes me realize though that what we probably want is, in fact:
[ ! -z "$PID" ] && /usr/bin/mpd --kill /etc/mpd.conf &> /dev/null
so that the MPD that starts from the script is the one that is killed.
Comment by Roman Kyrylych (Romashka) - Saturday, 07 April 2007, 14:43 GMT
done in mpd-0.12.2-1, please report if you found any issues

Loading...