LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   new daemon - start and stop questions (http://www.linuxquestions.org/questions/slackware-14/new-daemon-start-and-stop-questions-684279/)

zoran119 11-18-2008 05:09 AM

new daemon - start and stop questions
 
Hi, I have installed mpd (music player daemon) and wanted to check if what I'm planning to do is ok.

Now, the mpd package has put /etc/rc.d/rc.mpd in for me, but just making it executable was not enough to make it start.

Having a look through the scripts, this is my solution:

Add this to rc.M
Code:

if [ -x /etc/rc.d/rc.mpd ]; then
  /etc/rc.d/rc.mpd start
fi

Add this to rc.0
Code:

if [ -x /etc/rc.d/rc.mpd ]; then
  /etc/rc.d/rc.mpd stop
fi

Is this the best way of doing what I want?

vladmihaisima 11-18-2008 05:26 AM

This depends on the distrubution. On Fedora you can use "chkconfig". On Gentoo you can use "rc-update". Please specify distribution if you want more info...

rg3 11-18-2008 05:27 AM

I'd put the starting block inside rc.local, and either ommit the stop block if it's fine, or put it inside rc.local_shutdown.

zoran119 11-18-2008 05:39 AM

Quote:

Originally Posted by rg3 (Post 3346128)
I'd put the starting block inside rc.local, and either ommit the stop block if it's fine, or put it inside rc.local_shutdown.

That is much better than hacking at the rc.M and rc.0.

Thank you!


All times are GMT -5. The time now is 02:46 PM.