You are not logged in.
Maybe this is tivial, but I searched about an hour without any results. I want to run mpd as user mpd. I cant use the mpd config file since mpd set the UID and GID explicitely resulting in mpd not having the necessary supplementary groups to access the locally shared music on my pc. Well I tried to run mpd with systemd by
# systemctl start mpdand the systemd contains the user mpd
$ cat /etc/systemd/system/default.target.wants/mpd.service
[Unit]
Description=Music Player Daemon
After=network.target sound.target
[Service]
User=mpd
ExecStart=/usr/bin/mpd --no-daemon
# allow MPD to use real-time priority 50
LimitRTPRIO=50
LimitRTTIME=-1
# move MPD to a top-level cgroup, as real-time budget assignment fails
# in cgroup /system/mpd.service, because /system has a zero real-time
# budget; see
# http://www.freedesktop.org/wiki/Software/systemd/MyServiceCantGetRealtime/
ControlGroup=cpu:/mpd
# assign a real-time budget
ControlGroupAttribute=cpu.rt_runtime_us 500000
[Install]
WantedBy=default.targetbut it did not run as mpd.
Well how can I run mpd as mpd? Is there a way to do it like with dropbox: dropbox@<user>.service
Last edited by manuelschneid3r (2015-03-25 12:52:52)
Please feel free to correct my english.
Offline
Finally found the problem. Somehow there was an mpd.service.d/ folder in /etc/systemd/system, which is thought to configure the service without changing the service file. The folger contained a file containing "User=", hence the service user fell back on root. Removing this solved the problem.
# ps -eo user,group,supgrp,args | grep " mpd"
mpd mpd mpd,audio,users /usr/bin/mpd --no-daemonPlease feel free to correct my english.
Offline
Glad you solved it. Was just typing a response and I'll still add two remarks:
The ps|grep output showed that you run grep as root, not mpd itself (which won't have a space in the command -- the second time it only worked because the mpd group is preceded by a space).
It sounds like it took you a while to find the drop-in configuration snippet in the mpd.service.d directory. These drop-in are shown in `systemctl status`, which is something you'd normally check in situations like these, and that might help to discover them more quickly.
Last edited by Raynman (2015-03-25 12:58:36)
Offline