I generally checkout trunk or a release tag to /opt/red5/ then use the sysv
script extracted from the .deb package ( thanks simon ) together with monit
to keep red5 running happily. You have to run 'ant jar' after checkout and
also sometimes add JAVA_HOME or other environmental vars inside the
red5.shscript if you don't have them set in /etc/profile. Here are the
files, it
may helps someone. They might be a bit debian specific.
/etc/init.d/red5 ( set to load at startup with update-rc.d script )
#########################################
#! /bin/sh
#
# red5 red5 initscript
#
# Author: Simon Eisenmann <[EMAIL PROTECTED]>.
#
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="Red5 flash streaming server"
NAME=red5
RED5_HOME=/opt/red5
DAEMON=$RED5_HOME/$NAME.sh
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
USER=deploy
GROUP=deploy
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
# Read config file if it is present.
if [ -r /etc/red5.conf ]
then
. /etc/red5.conf
fi
#
# Function that starts the daemon/service.
#
d_start() {
start-stop-daemon --start --pidfile $PIDFILE \
--chdir $RED5_HOME --background --make-pidfile \
-c $USER -g $GROUP \
--exec $DAEMON
}
#
# Function that stops the daemon/service.
#
d_stop() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--name java -u $USER
rm -f $PIDFILE
}
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
d_stop
echo "."
;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
d_stop
sleep 1
d_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
#########################################
/etc/monit/includes/red5 ( see http://www.tildeslash.com/monit/ for info on
monit )
#########################################
check process red5 with pidfile /var/run/red5.pid
start program = "/etc/init.d/red5 start"
stop program = "/etc/init.d/red5 stop"
group server
depends red5_init, red5_sh
check file red5_init with path /etc/init.d/red5
group server
check file red5_sh with path /opt/red5/red5.sh
#########################################
- Luke
On 6/20/07, Tony Langdon (ATC) <[EMAIL PROTECTED]> wrote:
> You might want to add nohup to that:
>
> nohup <path to red5.sh> &
>
> If you don't know what nohup does, check out the manpage:
>
> man nohup
nohup will work well in this situation, I use it a lot when I want to kick
something off by hand. An alternative approach which works well for a
startup script (e.g. /etc/rc.d/rc.local on Red Hat-ish systems) is
/bin/su - -c "<path to red5.sh>" <red5user> >&/dev/null 2>&1 &
Starts red5 as the correct UNIX user.
If you want to log the console output, redirect to the appropriate log
file
instead of /dev/null.
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org
--
Luke Hubbard
codegent | coding for the people
http://www.codegent.com
NMA Top 100 Interactive Agencies - Ones to watch!
http://www.codegent.com/top100/
want to know more?
http://www.codegent.com/showreel/
This e-mail may contain information which is privileged, confidential and
protected from disclosure. If you are not the intended recipient of this
e-mail, or any part of it, please delete this email and any attachments
immediately on receipt. You should not disclose the contents to any other
person or take copies. Any views expressed in this message are those of the
individual sender, except where the sender specifically states them to be
the views of codegent limited.
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org