Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ezstream startscript

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Fri Jun 22, 2007 11:09 pm    Post subject: ezstream startscript Reply with quote

Here is a little start/stop script for ezstream. use it, if you want to. tested under debian sarge with ezstream-0.2.1

Code:

#! /bin/sh
#
# icecast2
#
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#               Modified for Debian
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
#               Further modified by Keegan Quinn <ice@thebasement.org>
#               for use with Icecast 2
#               Further modified by disod <disod@gmx.net>
#               for use with ezstream
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/ezstream
NAME=ezstream
DESC=ezstream

test -x $DAEMON || exit 0

# Defaults
CONFIGPATH="/etc/ezstream/"
CONFIGFILE="default.xml"
CONFIGDEFAULTFILE="/etc/default/ezstream"
PIDPATH="/var/run/ezstream/"
USERID=ezstream
GROUPID=ezstream
ENABLE="true"

# Reads config file (will override defaults above)
[ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE

if [ "$ENABLE" != "true" ]; then
        echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
        exit 0
fi




if [ "$2" != "" ]; then
        echo "Overriding default config file..."
        CONFIGFILE="$2"
fi


PIDFILE="$PIDPATH$CONFIGFILE.ezstream.pid"
CONFIGFILE="$CONFIGPATH$CONFIGFILE"

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet \
                --background --make-pidfile --pidfile $PIDFILE --chuid $USERID:$GROUPID --exec $DAEMON -- -c $CONFIGFILE
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --oknodo --quiet --pidfile $PIDFILE
        echo "$NAME."
        ;;
  reload|force-reload|restart)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet \
                --background --make-pidfile --pidfile $PIDFILE --chuid $USERID:$GROUPID --exec $DAEMON -- -c $CONFIGFILE
        echo "$NAME."
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac

exit 0


disod
Back to top
kai4711



Joined: 21 Nov 2007
Posts: 30

PostPosted: Sun Jan 20, 2008 12:32 am    Post subject: Reply with quote

This works very cool, but when I add it to the runlevels rc0.d-rc6.d it doesnt startup on reboot. (via update-rc.d blah defaults)

It creates the pid file with a pid number, but this process dies obviously.

When call it with start or stop on runtime in the console everythin works fine...

Anyone an idea?

Maybe there is a problem, because icecast isnt really up one the time ezstream starts, but normally it waits some seconds and tries again, does it?

Thank you very much,
Kai
Back to top
View user's profile Send private message
Spook



Joined: 14 Sep 2009
Posts: 4
Location: Berlin, Germany

PostPosted: Wed Mar 06, 2013 9:18 am    Post subject: During boot ezstream always starts before icecast is up Reply with quote

Hi,
I have a similar if not the same problem as kai4711 has.
My OS is Debian squeeze with a 2.6.32-5-686 Kernel.
After adjusting the script to my environment regarding pathes etc. the script itself runs great from within a terminal at runtime.
So far so good.
Including it into the boot sequences for example in runlevel 2 I located icecast2 with a high priority ( S01icecast2 ) and ezstream with a much lower priority ( S20ezstream ) in the diretory /etc/rc2.d/
The above mentioned "files" are not files but links to the real start scripts located in /etc/init.d

Has anybody an idea what I am doing wrong?

Any kind of help very much appreciated.

Cheers!
Michael
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber