[Icecast] startup script for icecast

Klaas Jan Wierenga k.j.wierenga at home.nl
Wed Jun 21 07:47:23 PDT 2006


Hi Dave,

I've also written my own startup script, but have since switched to 
using daemontools with great success.

http://www.google.com/search?q=daemontools (second match)
http://cr.yp.to/daemontools.html

Daemontools is easy to install (you should be able to find an rpm for it).

It will allow you to bring up/down icecast, send HUP, and also to 
automatically restart it in case it would crash. Check it out.

Regards,

KJ

Dave wrote:
> 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
>
> _______________________________________________
> Icecast mailing list
> Icecast at xiph.org
> http://lists.xiph.org/mailman/listinfo/icecast
>



More information about the Icecast mailing list