zoukankan      html  css  js  c++  java
  • linux启动脚本(Red5)

    vi /etc/init.d/red5

    #!/bin/bash
    #
    For RedHat and cousins:
    #
    chkconfig: 2345 85 85
    #
    description: Red5 flash streaming server
    #
    processname: red5
    #
    Created By: Sohail Riaz (sohaileo@gmail.com)

    PROG=red5
    RED5_HOME=/usr/local/red5
    DAEMON=$RED5_HOME/$PROG.sh
    PIDFILE=/var/run/$PROG.pid

    # Source function library
    . /etc/rc.d/init.d/functions

    [ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5

    RETVAL=0

    case "$1" in
    start)
    echo -n $"Starting $PROG: "
    cd $RED5_HOME
    $DAEMON >/dev/null 2>/dev/null &
    RETVAL=$?
    if [ $RETVAL -eq 0 ]; then
    echo $! > $PIDFILE
    touch /var/lock/subsys/$PROG
    fi
    [ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
    echo
    ;;
    stop)
    echo -n $"Shutting down $PROG: "
    killproc -p $PIDFILE
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
    ;;
    restart)
    $0 stop
    $0 start
    ;;
    status)
    status $PROG -p $PIDFILE
    RETVAL=$?
    ;;
    *)
    echo $"Usage: $0 {start|stop|restart|status}"
    RETVAL=1
    esac

    exit $RETVAL

    将启动脚本添加到服务
    chmod +x /etc/rc.d/init.d/red5
    /sbin/chkconfig –add red5
    /sbin/chkconfig red5 on
    /sbin/service red5 start



  • 相关阅读:
    2019天梯赛训练1
    Python课程设计 搭建博客
    最容易理解的贪吃蛇小游戏
    数据结构-队列
    数据结构-堆栈(2)
    数据结构-堆栈(1)
    数据结构-线性表(3)
    数据结构-线性表(1)
    linux知识积累
    Maven学习笔记
  • 原文地址:https://www.cnblogs.com/qq78292959/p/2361277.html
Copyright © 2011-2022 走看看