mpd init script

 
Post new topic   Reply to topic    Lunar-Linux Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
hitchi



Joined: 06 Nov 2006
Posts: 9

PostPosted: Fri Nov 10, 2006 8:11 pm    Post subject: mpd init script Reply with quote

Does anybody care to handle a mpd init scrip to a unskilled user?
Back to top
View user's profile Send private message
Jannis



Joined: 21 Apr 2006
Posts: 6
Location: Lübeck, Germany

PostPosted: Sat Nov 11, 2006 8:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website ICQ Number
hitchi



Joined: 06 Nov 2006
Posts: 9

PostPosted: Sun Nov 12, 2006 5:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Jannis



Joined: 21 Apr 2006
Posts: 6
Location: Lübeck, Germany

PostPosted: Mon Dec 18, 2006 11:43 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website ICQ Number
hitchi



Joined: 06 Nov 2006
Posts: 9

PostPosted: Mon Dec 18, 2006 2:17 pm    Post subject: Reply with quote

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 Rolling Eyes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Lunar-Linux Forum Index -> General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group