You are not logged in.

#1 2013-06-02 22:05:24

miscsubbin
Member
Registered: 2012-10-30
Posts: 37

[Solved] MPD won't play when started via systemd

When I try to play from mpd (after starting it from systemd with "systemctl start mpd"), nothing happens. In ncmpcpp, when I press play, it quickly shows play and then immediately goes to "paused". When I start MPD normally from the command line (just by running "mpd"), it works fine, but for some reason, some conflict is being caused by systemd.

Is there anywhere I should start to look? I don't really know how to troubleshoot it, as I don't know how to make it log without running it from the command line.

EDIT: I set up systemd --user and wrote a service for it. It seems that mpd was running as root and caused some permissions issues.

Last edited by miscsubbin (2013-06-11 01:03:34)

Offline

#2 2013-06-02 22:43:27

snowbear
Member
From: Prague, Czech Republic
Registered: 2007-02-02
Posts: 11

Re: [Solved] MPD won't play when started via systemd

Have you already tried to check whether the mpd is running by "systemctl status mpd" or "netstat -lptn"?

Offline

#3 2013-06-03 10:18:13

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [Solved] MPD won't play when started via systemd

Output ends up in the journal by default.

When starting "normally", do you also start mpd as root (since there is no "--user" in your systemctl call)?

Offline

#4 2013-06-07 00:49:02

Saro
Member
Registered: 2012-04-02
Posts: 4

Re: [Solved] MPD won't play when started via systemd

Similar problem here. I just moved from mpd-git to mpd. When I start mpd from shell as root (with sudo) it works normally, but when I try to use systemctl to run the service it looks stuck and mpd doesn't start.

Ok, I solved reinstalling systemd. May be with the last "dangerous" update I broke something in it.

Last edited by Saro (2013-06-07 00:51:32)

Offline

#5 2013-06-09 14:59:59

miscsubbin
Member
Registered: 2012-10-30
Posts: 37

Re: [Solved] MPD won't play when started via systemd

Raynman wrote:

Output ends up in the journal by default.

When starting "normally", do you also start mpd as root (since there is no "--user" in your systemctl call)?

I just checked and it is running as root, however, when I do

systemctl --user enable mpd

I get:

Failed to issue method call: Process /bin/false exited with status 1

Offline

#6 2013-06-09 21:52:46

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] MPD won't play when started via systemd

Unless you have actually set up systemd --user, it is not going to work.  But there is an alternative, as you can simply specify User=<you> in the mpd.service file (or any service for that matter) and it will run the command as <you> rather than root.

What I have done is created an mpd@.service and then have "User=%I" so that I can start/enable mpd@wonderwoofy.service.

Offline

#7 2013-06-11 01:02:36

miscsubbin
Member
Registered: 2012-10-30
Posts: 37

Re: [Solved] MPD won't play when started via systemd

I've decided to set up systemd --user mostly because I was bored. And that made mpd work. Thanks!

However I also tried switching from slim to lightdm, and starting my wm with systemd --user. So now I get a grey screen instead of a window manager. Perhaps I'll make another thread... haha!

Offline

Board footer

Powered by FluxBB