<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                # Swoole守護服務shell源碼 使用方法 http://www.hmoore.net/mikkle/thinkphp5_study/376460 ~~~ #!/bin/bash # chkconfig: 2345 10 90 # description: Start and Stop Mikkle # power by Mikkle # QQ 776329498 PHP="/www/wdlinux/php/bin/php" MIKKLE_DIV="/www/web/wechat" MIKKLE_SCRIPT='think' #服務腳本 MIKKLE_NAME="socketServer" #你自定義的服務名稱 MIKKLE_PID="${MIKKLE_DIV}/shell/service/${MIKKLE_NAME}.pid" #服務PID MIKKLE_LOG="${MIKKLE_DIV}/shell/log/${MIKKLE_NAME}.log" #服務運行日志 記錄錯誤信息 #判斷程序是否已經在運行 status_script(){ ps -fe|grep ${MIKKLE_SCRIPT}|grep ${MIKKLE_NAME}|grep -v grep if [ $? -eq 0 ] then echo ${0}' Is running' running=1 elif [ $? -ne 0 ] then echo $0" is NOT running" running=2 fi } #啟動腳本,先判斷腳本是否已經在運行 start_script(){ status_script if [ ${running} -eq 1 ] then echo ${0}' Is starting ...' else echo 'start' ${0} '...' cd ${MIKKLE_DIV} nohup ${PHP} ${MIKKLE_SCRIPT} ${MIKKLE_NAME}>/dev/null 2>${MIKKLE_LOG} & echo $! > ${MIKKLE_PID} echo "start finish,PID $!" fi } #停止腳本 stop_script(){ status_script if [ ${running} -ne 1 ] then echo ${0}' no starting '$?... else PIDS=`ps aux|grep ${MIKKLE_SCRIPT}|grep ${MIKKLE_NAME}| grep -v grep |awk '{print $2}'` for kill_pid in ${PIDS} do kill -9 -TERM ${kill_pid} >/dev/null 2>&1 echo "Kill pid ${kill_pid} .." done echo 'stop complete' return 1 fi } #重啟腳本 reload_script(){ stop_script sleep 3 start_script } #入口函數 handle(){ case $1 in start) start_script ;; stop) stop_script ;; status) status_script ;; reload) reload_script ;; restart) reload_script ;; *) start_script echo 'MIKKLE OF THIS SERVER IS '${0} 'status|start|stop|restart'; ;; esac } if [ $# -eq 1 ] then handle $1 else echo 'Mikkle OF THIS SERVER IS '${0} 'status|start|stop|restart'; fi ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看