View previous topic :: View next topic |
Author |
Message |
hitchi
Joined: 06 Nov 2006 Posts: 9
|
Posted: Fri Nov 10, 2006 8:11 pm Post subject: mpd init script |
|
|
Does anybody care to handle a mpd init scrip to a unskilled user? |
|
Back to top |
|
 |
Jannis
Joined: 21 Apr 2006 Posts: 6 Location: Lübeck, Germany
|
Posted: Sat Nov 11, 2006 8:20 pm Post subject: |
|
|
Please have a look at http://musicpd.org/faq.shtml#Q10 which clearly says that mpd is not intended to be run as root - thus, an init script is probably not necessary.
Why not add it to the list of autostart applications of your Desktop Environment? This is what I do, so whenever I log in, mpd is started (if my USB drive with the music is mounted). |
|
Back to top |
|
 |
hitchi
Joined: 06 Nov 2006 Posts: 9
|
Posted: Sun Nov 12, 2006 5:20 am Post subject: |
|
|
Well, if run as user, mpd drops root privileges, also i have it binded to localhost, so i don't think there is any real danger.
I don't want to startx just to run mpd (or have it killed by quiting X) so i put this i "/etc/init.d/mpd" :
[/code]
#! /bin/bash
#
# mpd Start/Stop the mpd daemon.
#
# chkconfig: 3 12 88
# description: MPD is a Music Player Daemon
# processname: mpd
# pidfile: /var/lib/mpd/mpd.pid
. /lib/lsb/init-functions
[/code]
It seems to do the job.
Thank you non the less. |
|
Back to top |
|
 |
Jannis
Joined: 21 Apr 2006 Posts: 6 Location: Lübeck, Germany
|
Posted: Mon Dec 18, 2006 11:43 am Post subject: |
|
|
I just found some time browsing the forums again, finally.
Again: MPD is not intended to be run as root. AFAIK, if run "mpd" from an X terminal or a DE session manager, it won't quit when you decide to restart X. So it should be sufficient to add the mpd call to ~/.bashrc, ~/.profile or whatever. |
|
Back to top |
|
 |
hitchi
Joined: 06 Nov 2006 Posts: 9
|
Posted: Mon Dec 18, 2006 2:17 pm Post subject: |
|
|
I'm sorry, you're right, mpd doesn't quit when restarting X.
But the init script isn't that insecure since mpd is setup in my config to run as user as per the http://musicpd.org/faq.shtml#Q10
Aniway the call in ~/.bashrc is good thinking and makes the all ideia of an init script kind of useless; i guess i just like the automation  |
|
Back to top |
|
 |
|