• php-fpm之启动脚本


    #!/bin/bash -
    #
    #php-fpm - this script starts and stops the php-fpm daemin
    #########################################################
    #                                                       #
    # 85 15 代表S和K的默认排序号。启动序号(85);关闭序号15       #
    # 3代表运行级别,如果默认所有级别不启动,那就用"-"表示         #
    #                                                       #   
    #########################################################
    #chkconfig: 3 85 15
    #description: php-fpmd is PHPFastCGI manager,only for PHP
    #
    #processname:php-fpm
    #pidfile:  /usr/local/php/var/run/php-fpm.pid
    #logfile:  /usr/local/php/var/log/php-fpm.log
    
    #Source function library. ". /" - 运行文件
     . /etc/rc.d/init.d/functions
    
    #Source networking configuration.
     . /etc/sysconfig/network
    
    #Check that networking is up.
     [ "$NETWORKING" = "no" ] && exit 0
    
    phpfpm="/usr/local/php/sbin/php-fpm"
    prog=$(basename $phpfpm)
    
    
    lockfile=/var/lock/subsys/phpfpm
    
    start(){
        [ -x $phpfpm ] || exit 5
         echo -n $"Starting $prog: "
        daemon $phpfpm 
        retval=$?
        echo
        [ $retval -eq 0 ] && touch $lockfile
        return $retval
    }
    
    stop() {
        echo -n $"Stopping $prog: "
        killproc $prog -QUIT
        retval=$?
        echo
        [ $retval -eq 0 ] && rm -f $lockfile
        return $retval
    }
    
    restart() {
        stop
        start
    }
    
    reload() {
        configtest || return $?
        echo -n $"Reloading $prog: "
        killproc $phpfpm -HUP
        RETVAL=$?
        echo
    }
    
    force_reload() {
        restart
    }
    
    rh_status() {
        status $prog
    }
    
    rh_status_q() {
        rh_status >/dev/null 2>&1
    }
    
    case "$1" in
        start)
            rh_status_q && exit 0
            $1
            ;;
        stop)
            rh_status_q || exit 0
            $1
            ;;
        restart|configtest)
            $1
            ;;
        reload)
            rh_status_q || exit 7
            $1
            ;;
        force-reload)
            force_reload
            ;;
        status)
            rh_status
            ;;
        condrestart|try-restart)
            rh_status_q || exit 0
                ;;
        *)
            echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
            exit 2
    esac
  • 相关阅读:
    实现分享功能(分享到qq空间,新浪微博)
    AXIOS构建请求处理全局loading状态&&AXIOS避免重复请求loading多次出现
    Vue.use() 方法
    判断浏览器版本
    判断当前环境是ios还是安卓
    如何理解react中的super() super(props)
    JavaScript 函数调用时带括号和不带括号的区别
    npm 安装时 --save --dev 和 --save 区别
    npm 全局安装和局部安装的区别
    module.exports 与 exports
  • 原文地址:https://www.cnblogs.com/changbo/p/5021634.html
Copyright © 2020-2023  润新知