Article Title: how to set RED5 as a system service in Linux. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories, why should we set them to system services? Because the red5 I installed on a server does not know why, in rc. local cannot start with the system, ln to rc. X does not work either. try your best to solve the problem by setting it to a system service...
Modify red5.sh
#!/bin/sh## Startup script for Red5 flash streaming server## chkconfig: 345 81 81# description: RED5 by java## processname: java (unfortunately)# pidfile: /var/run/red5.pid# config: /etc/red5.conf# Source function library.. /etc/rc.d/init.d/functionsPID_FILE=/var/run/red5.pidPID=`ps ax |grep java|grep red5|awk '{print $1;}'`RETVAL=0start() {echo -n $"Starting $DESCR: "# daemon java $OPTIONS > /dev/null 2>&1 &export ANT_HOME=/opt/apache-ant-1.6.5export JAVA_HOME=/opt/jdk1.5.0_06export JAVA_VERSION=1.5export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/binexec $JAVA_HOME/bin/java -Djava.security.manager -Djava.security.policy=/opt/red5/conf/red5.policy -cp /opt/red5/red5.jar:conf:/opt/red5/conf org.red5.server.Standalone > /dev/null 2>&1 & RETVAL=$?[ $RETVAL = 0 ] && touch /var/lock/subsys/red5 && echo $!>$PID_FILE && echo_successechoreturn $RETVAL}stop() {echo -n $"Stopping $DESCR: "#killproc $PID_FILE[[ $PID != "" ]] && success && kill $PID || failureRETVAL=$?echo[ $RETVAL = 0 ] && rm -f /var/lock/subsys/red5 $PID_FILE}# See how we were called.case "$1" instart)start;;stop)stop;;restart)stopsleep 3start;;*)echo $"Usage: $DESCR {start|stop|restart"exit 1esacexit $RETVAL
|
Note: The preceding comments are required. You can fix them.
Put it in/etc/init. d/
Mv/opt/red5/red5.sh/etc/init. d/red5
You can directly start or stop the service red5 start | stop
Set to start the chkconfig red5 on Service