[Icecast] startup script for icecast

Dave dmehler26 at woh.rr.com
Wed Jun 21 06:06:03 PDT 2006


Hello,
    I was wondering about the feasibility of including a startup script for 
icecast for redhat/fedora installs? I've had to do an rpm install on an fc4 
box, and a source install, rpms couldn't be found for an rh9 machine, yah i 
know that's old. And in both cases i had to drop in a custom-made startup 
script, see below. I was wondering esepcially in the case of the rpm, and to 
a lesser extent the source, if this could be included? I've had to change 
the below paths for both source and rpm installs since they put items, 
(Config file and binaries), in different places.
Thanks.
Dave.

#!/bin/bash
#
# Startup script for icecast
#
# chkconfig: 2345 86 25
# description: Icecast Streaming Server
#
# processname: icecast2
# config: /usr/local/icecast/conf/icecast.xml
# pidfile: /usr/local/icecast/logs/icecast2.pid

# source function library
. /etc/rc.d/init.d/functions

RETVAL=0
prog="icecast2"

# Some functions to make the below more readable
ICECAST2=/usr/bin/icecast
PID_FILE=/usr/local/icecast/logs/icecast2.pid
CONFIG_FILE=/usr/local/icecast/conf/icecast.xml

start()
{
 echo -n $"Starting $prog:"
# initlog -c "$ICECAST2 $OPTIONS" && success || failure
 initlog -c "$ICECAST2 -b -c $CONFIG_FILE" && success || failure
 RETVAL=$?
 [ "$RETVAL" = 0 ] && touch /var/lock/subsys/icecast2
 echo
}

stop()
{
 echo -n $"Stopping $prog:"
 killproc $ICECAST2 -TERM
 RETVAL=$?
 [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/icecast2
 echo
}

restart()
{
 echo -n $"Reloading $prog:"
 killproc $ICECAST2 -HUP
 RETVAL=$?
 echo
}

case "$1" in
 start)
  start
  ;;
 stop)
  stop
  ;;
 restart)
  stop
  start
  ;;
 status)
  status $ICECAST2
  RETVAL=$?
  ;;
 *)
  echo $"Usage: $0 {start|stop|restart|status}"
  RETVAL=1
esac
exit $RETVAL



More information about the Icecast mailing list