How to start mpd at boot time

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
SPlissken
Posts: 23
Joined: 1. Jan 2010, 22:10
Location: France

How to start mpd at boot time

Post by SPlissken »

Hello all.

First happy new year.
Second , great work all for this great distro.

I have just installed mpd + Ario.
It's working great but i don't know how to start mpd at boot time.
There is no mpd in /etc/rc.d/

Thanks for any answers
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: How to start mpd at boot time

Post by gapan »

I'll try to help, but I'm not sure I can, since I never really used mpd.

Do you need to start mpd as root, or as a non-privileged user? If you want to start it as root, you could add it in /etc/rc.d/rc.local. If you want to start it as a non-privileged user, then you could probably add it in the autostarted applications in xfce, so it starts every time you log in xfce..
Image
Image
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: How to start mpd at boot time

Post by Shador »

There's no need to run it as root. I usually launch it with my user.
So either add it to your xfce/openbox/... autostart or add something like this to your rc.local:

Code: Select all

su shador -c 'mpd &'
Alternatively you could also create a separate mpd user, but that's imho a bit overkill.

I don't think that there's a need for a mpd rc scripts, as it's usually a per-user thing and running it like a server with its own user is probably rather overkill.
Image
SPlissken
Posts: 23
Joined: 1. Jan 2010, 22:10
Location: France

Re: How to start mpd at boot time

Post by SPlissken »

Well normally, mpd is supposed to start at boot time , as you can see on mpd wiki page on various explanations for ArchLinux, Gentoo, FreeBSD.....
On FreeBSD for example , you just have to add musicpd_enable=YES in /etc/rc.conf

http://mpd.wikia.com/wiki/Install

May be something is missing in the installation from SalixOS
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: How to start mpd at boot time

Post by gapan »

Nothing is missing. If you want it autostarted, use rc.local. That's what it's there for.
Image
Image
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: How to start mpd at boot time

Post by Shador »

There's nothing missing and unless you instruct mpd to switch uuid and guid or launch it with su <user>, I don't recommend launching it from rc.local, because it imposes a security risk.
That's the reason why there is no rc script for it. If there was on there had to be some default config, which wouldn't work ootb (usually) and there would be no way to guarantee that it's launched as a non-root user. If you want to impose that risk on you add it to rc.local, which is btw as simple as making a complicated possibly error-prone rc script executable.
Just add 'mpd &' to rc.local, if you don't care about running it as root.
Image
Post Reply