Why do you want to set up a system service? Because I am installed on a server Red5 for no reason, in rc.local there can not be started with the system, LN to RC. X is not a good idea. If you try your best, you have to set up a system service to solve the problem ...
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/functions
Pid_file=/var/run/red5.pid
Pid= ' PS ax |grep java|grep Red5|awk ' {print $} ' `
Retval=0
Start () {
Echo-n $ "Starting $DESCR:"
# daemon Java $OPTIONS >/dev/null 2>&1 &
Export ant_home=/opt/apache-ant-1.6.5
Export java_home=/opt/jdk1.5.0_06
Export java_version=1.5
Export path= $PATH: $JAVA _home/bin: $ANT _home/bin
EXEC $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_success
Echo
Return $RETVAL
}
Stop () {
Echo-n $ "Stopping $DESCR:"
#killproc $PID _file
[[$PID!= "]] && success && Kill $PID | | Failure
Retval=$?
Echo
[$RETVAL = 0] && rm-f/var/lock/subsys/red5 $PID _file
}
# How we were called.
Case "$" in
Start
Start
;;
Stop
Stop
;;
Restart)
Stop
Sleep 3
Start
;;
*)
echo $ "Usage: $DESCR {start|stop|restart"
Exit 1
Esac
Exit $RETVAL
Note: It is necessary to comment on those contents before. can be repaired.
Put it in the/etc/init.d/.
Mv/opt/red5/red5.sh/etc/init.d/red5
You can start or stop service Red5 start|stop directly
Set to start service Chkconfig Red5 on