You are not logged in.

#1 2014-09-30 08:27:43

jayasinghe
Member
From: Germany
Registered: 2011-12-16
Posts: 23
Website

mpd won't start after recent upgrade

Hi!

After one of the last upgrades my mpd service does not start anymore.

● mpd.service - Music Player Daemon
   Loaded: loaded (/usr/lib/systemd/system/mpd.service; enabled)
   Active: failed (Result: exit-code) since Di 2014-09-30 10:21:04 CEST; 2s ago
  Process: 1489 ExecStart=/usr/bin/mpd --no-daemon (code=exited, status=1/FAILURE)
 Main PID: 1489 (code=exited, status=1/FAILURE)

Sep 30 10:21:04 lu10855 systemd[1]: Started Music Player Daemon.
Sep 30 10:21:04 lu10855 mpd[1489]: fatal_error: Failed to set group 92: Operation not permitted
Sep 30 10:21:04 lu10855 systemd[1]: mpd.service: main process exited, code=exited, status=1/FAILURE
Sep 30 10:21:04 lu10855 systemd[1]: Unit mpd.service entered failed state.

If I start mpd directly with mpd --no-daemon as root or via sudo it starts without any problems.
Group 92 is audio and the user mpd is part of that group. Do you have any ideas what is going wrong here?

Best Regards,
Robin

Last edited by jayasinghe (2014-09-30 08:43:43)

Offline

#2 2014-09-30 10:18:24

Roberth
Member
From: The Pale Blue Dot
Registered: 2007-01-12
Posts: 894

Re: mpd won't start after recent upgrade

I'm getting the same problem here, exept it's trying to set group 1000. I have specified my user's group in /etc/mpd.conf.


Use the Source, Luke!

Offline

#3 2014-09-30 10:45:01

jayasinghe
Member
From: Germany
Registered: 2011-12-16
Posts: 23
Website

Re: mpd won't start after recent upgrade

Here is my mpd.conf (stripped away all comments):

music_directory         "/var/music"
playlist_directory "/home/mpd/playlists"
db_file "/home/mpd/mpd.db"
log_file                        "syslog"
pid_file "/run/mpd/mpd.pid"
sticker_file                    "/home/mpd/sticker.sql"
user "mpd"
group                           "audio"
bind_to_address "127.0.0.1"
port                            "6600"
zeroconf_enabled                "yes"
zeroconf_name                   "Music Player"
input {
        plugin "curl"
}
audio_output {
    type                    "fifo"
    name                    "my_fifo"
    path                    "/tmp/mpd.fifo"
    format                  "44100:16:2"
}
audio_output {
        type            "alsa"
        name            "My ALSA Device"
}

Offline

#4 2014-09-30 12:47:16

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,371
Website

Re: mpd won't start after recent upgrade

jayasinghe wrote:

Hi!

After one of the last upgrades my mpd service does not start anymore.

● mpd.service - Music Player Daemon
   Loaded: loaded (/usr/lib/systemd/system/mpd.service; enabled)
   Active: failed (Result: exit-code) since Di 2014-09-30 10:21:04 CEST; 2s ago
  Process: 1489 ExecStart=/usr/bin/mpd --no-daemon (code=exited, status=1/FAILURE)
 Main PID: 1489 (code=exited, status=1/FAILURE)

Sep 30 10:21:04 lu10855 systemd[1]: Started Music Player Daemon.
Sep 30 10:21:04 lu10855 mpd[1489]: fatal_error: Failed to set group 92: Operation not permitted
Sep 30 10:21:04 lu10855 systemd[1]: mpd.service: main process exited, code=exited, status=1/FAILURE
Sep 30 10:21:04 lu10855 systemd[1]: Unit mpd.service entered failed state.

If I start mpd directly with mpd --no-daemon as root or via sudo it starts without any problems.
Group 92 is audio and the user mpd is part of that group. Do you have any ideas what is going wrong here?

Best Regards,
Robin

Systemd now starts the service as the mpd user by default (see /usr/lib/systemd/system/mpd.service). You can restore the previous behaviour by creating /etc/systemd/system/mpd.service.d/user.conf with the following content:

[Service]
User=

(will run mpd as root, which then has the capabilities to su to another user)

Though I'd recommend that you just let systemd handle the permissions setting rather than mpd. Comment out the user/group declarations in your mpd.conf and change the User declaration to the user/uid you want. Add in a Group declaration if you want too, though I don't think running processes as the audio group is a Good Idea™.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2014-09-30 13:45:44

jayasinghe
Member
From: Germany
Registered: 2011-12-16
Posts: 23
Website

Re: mpd won't start after recent upgrade

WorMzy wrote:

Systemd now starts the service as the mpd user by default (see /usr/lib/systemd/system/mpd.service). You can restore the previous behaviour by creating /etc/systemd/system/mpd.service.d/user.conf with the following content:

[Service]
User=

(will run mpd as root, which then has the capabilities to su to another user)

Though I'd recommend that you just let systemd handle the permissions setting rather than mpd. Comment out the user/group declarations in your mpd.conf and change the User declaration to the user/uid you want. Add in a Group declaration if you want too, though I don't think running processes as the audio group is a Good Idea™.

Thanks for your answer. That sounds reasonable. I guess that mpd and its configuration handling has to changed in order to work smoothly together with the new systemd behavior and I can use the described workaround for the time being. Correct?

Best Regards,
Robin

Offline

#6 2014-09-30 14:52:53

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,371
Website

Re: mpd won't start after recent upgrade

You just need to add a Group declaration to the user.conf file I described. That is a permanent solution, not a workaround.

You will need to run

# systemctl daemon-reload
# systemctl restart mpd

after creating/modifying the user.conf file for the changes to take effect, something that I neglected to mention in my previous post.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2014-09-30 18:24:58

jayasinghe
Member
From: Germany
Registered: 2011-12-16
Posts: 23
Website

Re: mpd won't start after recent upgrade

This helped indeed. Thanks for your support, WorMzy!

Offline

Board footer

Powered by FluxBB