FS#42172 - [mpd] failed to start with group setting in /etc/mpd.conf

Attached to Project: Arch Linux
Opened by wombalton (wombalton) - Monday, 29 September 2014, 08:58 GMT
Last edited by Gaetan Bisson (vesath) - Tuesday, 30 September 2014, 16:52 GMT
Task Type Bug Report
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 1
Private No

Details

Description:
mpd won't start through systemd when a group is set in /etc/mpd.conf. Starts fine from commandline.

Additional info:

systemd status:
Sep 29 10:44:08 bene-laptop mpd[5400]: fatal_error: Failed to set group 92: Operation not permitted
Sep 29 10:44:08 bene-laptop systemd[1]: mpd.service: main process exited, code=exited, status=1/FAILURE
Sep 29 10:44:08 bene-laptop systemd[1]: Unit mpd.service entered failed state.

I discovered this is due systemd starts mpd with only user permission of the user mpd.

/usr/lib/systemd/system/mpd.service:

[Service]
User=mpd
ExecStart=/usr/bin/mpd --no-daemon


And of course mpd has no right to change his group.

Solution:

Either delete the User=mpd part of the mpd service file and let mpd itself change the user

OR

add Group= part to systemd service file that matches the group of mpd.conf
This task depends upon

Closed by  Gaetan Bisson (vesath)
Tuesday, 30 September 2014, 16:52 GMT
Reason for closing:  Not a bug
Comment by wombalton (wombalton) - Monday, 29 September 2014, 09:00 GMT
sorry forgot to add mpd package version: 0.18.16-1
Comment by Gaetan Bisson (vesath) - Monday, 29 September 2014, 17:28 GMT
Our package now defaults to setting the user/group through systemd rather than mpd itself; see: https://bugs.archlinux.org/task/42089

Note that just having User= in the service file is fine: systemd will then automatically use the default Group for that User.

If you customize mpd to deviate from those default settings, it is up to you to ensure you leave the set of configuration files in a consistent state. Cheers.
Comment by wombalton (wombalton) - Tuesday, 30 September 2014, 12:10 GMT
Very well, if this is the desired default configuration then so be it. Then this is no bug and we can close this issue.
I added a paragraph in the wiki[1] to explain this for everyone.

[1] https://wiki.archlinux.org/index.php/Music_Player_Daemon/Troubleshooting#daemon:_fatal_error:_Failed_to_set_group_NN:_Operation_not_permitted

Cheers wombalton
Comment by Gaetan Bisson (vesath) - Tuesday, 30 September 2014, 16:52 GMT
Thanks for updating the wiki.

Loading...