nEMESIS4
10-07-2001, 10:28 AM
How do you setup a program to start when the server starts? I'm running a shoutcast server and would like the server to automatically start the server when it boots up, so I don't have to manually restart the shoutcast server after a reboot.
The command to run the shoutcast server is:
/usr/local/shout/sc_serv &
slade
10-07-2001, 03:32 PM
I'm not sure how comprehensive the Cobalt software is, but basic Unix would dictate you look in /etc/rc.d for a file called rc.local (for sane inits) and add your startup command to that line. Make sure it's chmod'ed +x.
If you look in there and find lots of mysteriously named "S" + two numbers files, you'll have to wait for someone who understands RedHat inits to tell you which one to put it in.
Mike the newbie
10-07-2001, 05:31 PM
Originally posted by nEMESIS4
How do you setup a program to start when the server starts? I'm running a shoutcast server and would like the server to automatically start the server when it boots up, so I don't have to manually restart the shoutcast server after a reboot.
The command to run the shoutcast server is:
/usr/local/shout/sc_serv &
Place that command at the end of the script file /etc/rc.d/rc.local
davidb
10-07-2001, 06:42 PM
Prepare for an error when you do that. I do not know if they fixed it or not, but when you run that, it might not find the config files. That was the problem with mine.
Mike the newbie
10-07-2001, 08:22 PM
Originally posted by davidb
Prepare for an error when you do that. I do not know if they fixed it or not, but when you run that, it might not find the config files. That was the problem with mine.
I've never run that particular program on my server, but the rc.local script is the way to run a program on startup.
Can you tell the shoutcast server where to find its config file via a command line parm?
nEMESIS4
10-07-2001, 11:03 PM
Thanks everyone, I added the command lines to the /etc/rc.d/rc.local file and it worked like a charm. These are the commands I used, this is how you use multiple servers. [to the best of my knowledge atleast, works perfectly]
/usr/local/shout/sc_serv /usr/local/shout/sc_serv1.conf &
/usr/local/shout/sc_serv /usr/local/shout/sc_serv3.conf &
/usr/local/shout/sc_serv /usr/local/shout/sc_serv4.conf &
/usr/local/shout/sc_serv /usr/local/shout/sc_serv5.conf &
/usr/local/shout/sc_serv /usr/local/shout/sc_serv6.conf &
Just dulplicate the config file with the necessary information for what you want to do and it should work fine. I have 5 servers running, 3 on different ip's, and 2 on the same IP. For the ones on the same IP just simply switch the port that it gets asigned to, to 8100 or something. Very easy program to does, huge props to Nullsoft for another brilliant program.
so the following would work as well?
/home/sites/home/blah../shout1/sc_serv /home/sites/home/blah../shout1/sc_serv.conf &
/home/sites/home/blah../shout2/sc_serv /home/sites/home/blah../shout2/sc_serv.conf &
Also, do you just add it at the bottom of the /etc/rc.d/rc.local ? Or is there a specific location you need to add it to?