You are not logged in.

#26 2014-07-11 21:31:32

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

@runical I took it from the last sed line, maybe it only recently changed. Not that it really matters in this case.

@Mugi When sticker_file gets commented out, at least that error should be gone. I wonder how you ended up with service files missing ExecStart in the first place.

Offline

#27 2014-07-11 21:34:12

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

emeres wrote:

@runical I took it from the last sed line, maybe it only recently changed. Not that it really matters in this case.

@Mugi When sticker_file gets commented out, at least that error should be gone. I wonder how you ended up with service files missing ExecStart in the first place.

I commented it out didn't try to reboot yet, will do it now.

EDIT: so now I get this error I guess this can be fixed with a local configuration?

fatal_error: Failed to create pid file "/run/mpd/mpd.pid": Permission denied

Last edited by Mugi (2014-07-11 21:35:56)

Offline

#28 2014-07-11 21:45:18

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

/run/mpd/ is probably owned by mpd, so adding your user to mpd group should be sufficient. Then log out and log in again.

Offline

#29 2014-07-11 21:51:14

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

emeres wrote:

/run/mpd/ is probably owned by mpd, so adding your user to mpd group should be sufficient. Then log out and log in again.

I added the user to the group with gpasswd -a lain mpd, and logged into another tty, it gives me still the same error.

Offline

#30 2014-07-11 21:54:07

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

So the previous tty session is still active? I would log out completely from every shell. How exactly are you starting the service? sudo systemctl start mpd?

Last edited by emeres (2014-07-11 21:55:17)

Offline

#31 2014-07-11 22:00:07

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

emeres wrote:

So the previous tty session is still active? I would log out completely from every shell. How exactly are you starting the service? sudo systemctl start mpd?

So first of all I just press ALT+Ctrl F[1-7], then I log in, but I will try to fully log out, and yes I'm starting it that way.

EDIT: No, even if I logout it gives me the same error, do I have to reboot or won't that make a difference?

Last edited by Mugi (2014-07-11 22:03:01)

Offline

#32 2014-07-11 22:07:15

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED]Can't start mpd

@emeres: Could be. Maybe I have an mpd update waiting tongue Also, from Mugi's first post:

Mugi wrote:

I can see that mpd.service is my problem (I accidently put the same in it as in mpd.service), but I searched everywhere but I just don't understand what I have to enter in it.

@Mugi: The error you see is because of permission problems. If you fix the permissions with the mpd group (if there is one), that should fix all of the problems here, be it using a local config or global. Please see the wiki to see what I mean by a local setup if you are confused.

Completely logging out of every shell also means loggin out of your x session btw.

Offline

#33 2014-07-11 22:07:49

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

Is the directory /run/mpd there?

Offline

#34 2014-07-11 22:09:24

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

runical wrote:

@emeres: Could be. Maybe I have an mpd update waiting tongue Also, from Mugi's first post:

Mugi wrote:

I can see that mpd.service is my problem (I accidently put the same in it as in mpd.service), but I searched everywhere but I just don't understand what I have to enter in it.

@Mugi: The error you see is because of permission problems. If you fix the permissions with the mpd group (if there is one), that should fix all of the problems here, be it using a local config or global. Please see the wiki to see what I mean by a local setup if you are confused.

Completely logging out of every shell also means loggin out of your x session btw.

Why can't I just logout in tty shell and test it there? I already tried getting my user into the group, but that didn't seem to fix the issue.

Last edited by Mugi (2014-07-11 22:09:45)

Offline

#35 2014-07-11 22:10:31

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

emeres wrote:

Is the directory /run/mpd there?

Yes, but there is nothing inside it.

Offline

#36 2014-07-11 22:11:57

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED]Can't start mpd

Can you create a file there with the user liam?

Offline

#37 2014-07-11 22:13:08

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

runical wrote:

Can you create a file there with the user liam?

Somehow not so there must be still issues with permissions.

Offline

#38 2014-07-11 22:23:14

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED]Can't start mpd

Indeed. Can you post the output of

ls -la /run | grep mpd

Offline

#39 2014-07-11 22:27:16

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

runical wrote:

Indeed. Can you post the output of

ls -la /run | grep mpd

Result:

drwxr-xr-x  2 mpd   mpd     40 Jul 11 22:12 mpd

Offline

#40 2014-07-11 22:28:49

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

If mpd is not shown with groups command, then just reboot.

Offline

#41 2014-07-11 22:31:40

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED]Can't start mpd

Ah, that explains it. The directory is indeed owned by the mpd group, but it doesn't have write permissions. So, all you have to do is add write permissions for the mpd group to the directory and you will be done (I think of course tongue).

Last edited by runical (2014-07-11 22:32:13)

Offline

#42 2014-07-11 22:35:11

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

runical wrote:

Ah, that explains it. The directory is indeed owned by the mpd group, but it doesn't have write permissions. So, all you have to do is add write permissions for the mpd group to the directory and you will be done (I think of course tongue).

How would I do that do you have a link to an article or something (sorry I'm still pretty new to GNU/Linux in general).

Offline

#43 2014-07-11 22:40:51

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

sudo chmod 775 /run/mpd

Offline

#44 2014-07-11 22:41:07

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [SOLVED]Can't start mpd

No problem. Our fine wiki has an article on file permissions. Please do read it, as it is really important to understand if you plan on using a distro like arch.

As for the quick fix:

sudo chmod g+w /run/mpd

Offline

#45 2014-07-11 22:44:10

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

Thanks alot for all the answeres, hope this will help people in the future with the same problem (will be marked as [SOLVED])

Offline

#46 2014-07-11 22:58:42

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

Should /run/mpd be deleted on the next boot or for whatever reason, you will have the same problem. Under [Service] section in /etc/systemd/system/mpd.service you can add:

User=mpd

That would run the service as mpd user. Other route could be using tmpfiles pointing to that directory with appropriate settings.

Now that your mpd is running, I recommend disabling mpd.service and enabling/starting mpd.socket. The service will be started when the mpd client tries to connect to mpd at the specified port.

Offline

#47 2014-07-11 22:59:26

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

emeres wrote:

Should /run/mpd be deleted on the next boot or for whatever reason, you will have the same problem. Under [Service] section in /etc/systemd/system/mpd.service you can add:

User=mpd

That would run the service as mpd user. Other route could be using tmpfiles pointing to that directory with appropriate settings.

Now that your mpd is running, I recommend disabling mpd.service and enabling/starting mpd.socket. The service will be started when the mpd client tries to connect to mpd at the specified port.

what would delete /run/mpd ?

Offline

#48 2014-07-11 23:09:25

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

I am not suggesting it will, but it might. Usually user error, running some cleaning script or other.

Where did you edit the service files? In /usr/lib/systemd/system or in /etc/systemd/system? Was is one of Arch Linux wikis you followed? Which one was it?

Last edited by emeres (2014-07-11 23:10:12)

Offline

#49 2014-07-11 23:17:51

Mugi
Member
Registered: 2014-07-08
Posts: 31

Re: [SOLVED]Can't start mpd

emeres wrote:

I am not suggesting it will, but it might. Usually user error, running some cleaning script or other.

Where did you edit the service files? In /usr/lib/systemd/system or in /etc/systemd/system? Was is one of Arch Linux wikis you followed? Which one was it?

https://wiki.archlinux.org/index.php/Mu … yer_Daemon

Offline

#50 2014-07-11 23:31:54

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [SOLVED]Can't start mpd

Feel free to contribute to the wiki if you were missing any information there or ask on its talk page if unsure.

Offline

Board footer

Powered by FluxBB