In Linux, how does one set RED5 as a system service?

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.