FS#27731 - [mpd] move pid file to /run/mpd.pid. allow mpd to run as other users

Attached to Project: Arch Linux
Opened by Jonathan Frazier (wide-eye) - Tuesday, 27 December 2011, 06:28 GMT
Last edited by Gaetan Bisson (vesath) - Wednesday, 21 March 2012, 11:59 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

1. With the recent symlinking of /var/run to /run there is no point in keeping the pid directory inside /var/run/

2. mpd.pid is the only user of /var/run/mpd, it doesn't need its own directory.

3. The mpd.install and rc.d/mpd scripts reset the uid and gid for mpd dirs with every startup and update. I find this annoying as I run mpd under another user.

Here are some build files to change the above. this including a warning about the pidfile movement as the old directory no longer exists.

my version is on github below, attached are the changes compared to mpd from abs.
https://github.com/JohnFrazier/arch-tmpfiles.d/tree/973adedd9aee6487c7b767aad1f296091576d82c/extra/mpd
This task depends upon

Closed by  Gaetan Bisson (vesath)
Wednesday, 21 March 2012, 11:59 GMT
Reason for closing:  Implemented
Additional comments about closing:  mpd-0.16.7-2 in [testing]
Comment by Jonathan Frazier (wide-eye) - Wednesday, 28 December 2011, 09:27 GMT
after further testing I find that mpd does need its own directory. so i added a tmpfile.d to create /run/mpd at boot. it can easily be reconfigured by the user. attached is the replacement diff, also on github.
Comment by wombalton (wombalton) - Thursday, 15 March 2012, 11:39 GMT
I was recently changing my system to use systemd and discovered that the mpd no longer starts correctly within the booting process. After some investigation I discovered that the init script is creating the directory /var/run/mpd with user and owner of mpd. However the systemd mpd.service does not do this and so mpd won't start because it wants to create a pid file in /var/run/mpd/. And since /var/run is just a symlink to /run which is a tmpfs there is no such directory. So I createt a new mpd.service in /etc/systemd/system and a script to properly create the directory before starting mpd in /etc/systemd. Now it works again.
   mpd (0.2 KiB)
   mpd.service (0.1 KiB)
Comment by Dave Reisner (falconindy) - Thursday, 15 March 2012, 12:08 GMT
Or better yet, mpd.service should run as non-forking and not write a PID at all.

http://git.musicpd.org/cgit/master/mpd.git/tree/mpd.service.in

Not really related to this bug, though.
Comment by Gaetan Bisson (vesath) - Wednesday, 21 March 2012, 11:15 GMT
I don't see the advantage of using tmpfiles.d over creating the directory from the rc.d script; it only makes things more complex...

Other than that, I'll soon push a new mpd to [extra] featuring your other suggestions.
Comment by Gaetan Bisson (vesath) - Wednesday, 21 March 2012, 11:58 GMT
Actually, it'll go to [testing] for a couple of days, just to see if everybody likes my changes...

Loading...