Run Shoutcast server on boot

por | 20 Noviembre, 2006

This works , unless you have the wrong binary

./sc_serv sc_serv.conf & (enter) From the directory where shoutcast sc_serv is located. You can have this binary anywhere on your OS and the configuration can also be anywhere.

If these commands below do not work for you, there is something WRONG. Plain and simple.

e.g. ./sc_serv_freebsd hackerradio.conf &
e.g. ./sc_serv_glibc hackerradio.conf &

ps -aux |grep sc_ (will show you if it running and what PID, owns it).

So lets just say you have sc_serv (generic name here), located in /usr/sbin/shoutcast, and the configs for shoutcast in /etc (pretty easy) and you want this to start with the OS booting up.

If you cant get options software or daemons to start with your system, talk with your sysadmin 🙂 DOH!

Some examplex that would work on red hat, debian, or any posic version of linux.

#!/bin/sh
# shoutcast.sh ; easy startup script.
#put this in /usr/bin or Or better, see start/kill
#script as they need to match this.
#chmod 655 shoutcast.sh

case “$1” in
‘start’)
echo -n “shoutcast start”
cd /usr/sbin/shoutcast && ./sc_serv /etc/shoutcast.conf &

;;
‘stop’)

# ya! ugly way to kill, but it kills it!
echo -n “shoutcast stop”
killall sc_serv

;;
*)
echo “Usage: $0 { start | stop }”
;;
esac
exit 0
# END , no duh

Now cd /etc/rc3.d

ln -s /usr/bin/shoutcast.sh S99shoutcast.sh

cd /etc/rc0.d
ln -s /usr/bin/shoutcast.sh K99shoutcast.sh

Now if the OS is behaving itself, when run level 3 starts (multi user, networking) S99shoutcast.sh will be fired up, when the system is shutting down, K99shoutcast.sh is run and killall should kill the shoutcast server.

Cheers.

~ HD