[Icecast] Running ices on startup

andre_grundmann at gmx.de andre_grundmann at gmx.de
Mon Sep 8 04:06:16 PDT 2008


Hi everyone.

I'm running icecast and ices2 on OpenSuse 10.2 (could upgrade to 11.0 in a breeze though).
What I'm trying to achieve right now is to use this for a kind of "baby-phone" functionality. 
That means:
1. There is a microphone attached to the server which records sound in the room
2. I'm in another room, listening to the server on Winamp, so I can hear what goes on in the room with the server

This works more or less fine, with one catch: icecast starts when I start the server, but ices doesn't. I have to start ices manually. This is unpleasant at least, so I would like to start ices on server startup. I already tried entering icecast into the runlevel manager and wrote a script to start it. What happens, is this:
Ices starts, if I run the script manually through the runlevel manager (runlevel manager reports success, and I hear sound), but after a bootup, no sound, although the runlevel manager still tells me ices is running. I can then still start ices manually, either using the script or running "ices /etc/ices.xml".

I had a similar setup with icecast and, I believe, oddsock on a Windows machine, and there I had the problem that icecast and the stream source would start concurrently, and the stream source couldn't find icecast, because it wasn't fully loaded yet. 

According to yast, icecast loads in runlevels 3 and 5, and ices loads in runlevel 5.

For good measure, the startup script:
#!/bin/bash

RETVAL=0
ICES2_BIN=/usr/bin/ices
test -x $ICES2_BIN || { echo "$ICES2_BIN not installed"; 
	if [ "$1" = "stop" ]; then exit 0;
	else exit 5; fi; }
# What you want to do when you start the script
start() {
  # put your commands here
  RETVAL=0
}

# What you want to do when you stop the script
stop() {
  # put your commands here
  RETVAL=0
}

case $1 in
  start)
	echo -n "Starting ices2 "
	## Start daemon with startproc(8). If this fails
	## the return value is set appropriately by startproc.
	/sbin/startproc $ICES2_BIN /home/mitarbeiter/icecast/ices.xml

	# Remember status and be verbose
	#rc_status -v
	;;
stop)
	echo -n "Shutting down ices2 "
	## Stop daemon with killproc(8) and if this fails
	## killproc sets the return value according to LSB.

	/sbin/killproc -TERM $ICES2_BIN

	# Remember status and be verbose
	#rc_status -v
	;;
  restart)
    stop
    start
    ;;
  status)
    # put here what you want to display on status command
    RETVAL=0
    ;;
  *)
    echo "Usage: name of script {start|stop|restart|status}"
    RETVAL=1
esac

Essentially a modified icecast startup script.

Hope you folks can help me out.

CU,
Andre
-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196


More information about the Icecast mailing list