<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 1. start-stop-daemon * 借鑒nginx啟動腳本 > * start-stop-daemon是一個用于控制系統級別的進程的開啟和關閉,也可以尋找進程是否正在運行。 * * * * * ### 1. 1檢查進程是否在運行 `sudo start-stop-daemon --start --pidfile /run/nginx.pid --exec /usr/sbin/nginx --test` >* --start:檢查進程是否存在,若進程存在什么也不做,退出返回錯誤代碼1,不存在返回0。當進程不存在時加--pidfile和--exec開啟一個進程。 >* --pidfile:保留進程運行時的ID的文件 >* -exec:檢查可執行的進行實體 > * --test測試進程是否存在,不會新建進程 ![](https://box.kancloud.cn/638830ceb22ed2c32c2a1fd69d126ee3_1071x67.png) * 因為進程存在,返回狀態碼1 * * * * * ### 1.2 建立一個進程 * start不加--test測試模式就可以了 ~~~ sudo start-stop-daemon --start --pidfile /run/nginx.pid --exec /usr/sbin/nginx ~~~ ![](https://box.kancloud.cn/d034f4cf7eb9083ecb6bb46e37f06f13_1034x245.png) ### 1.3 銷毀或者停止一個進程 ~~~ sudo start-stop-daemon --stop --pidfile /run/nginx.pid --retry 5 --name nginx ~~~ > * --stop:進程存在,停止進程返回0,不存在返回1 > * --retry:加timeout|schedule,schedule是以/分割的組TERM/30/KILL/5。 重復地檢查進程是否停止,signal/timeout/KILL/timeout > * --signal:通常和stop一起使用。指定給進程發送的信號量,默認TERM,nginx可以使用以下信號量 ![](https://box.kancloud.cn/fa11579af45374a6f263f04ee2707609_775x339.png) 發送重新讀取配置的信號量 ~~~ sudo start-stop-daemon --stop --pidfile /run/nginx.pid --signal HUP --name nginx ~~~ ~~~ --retry=TERM/30/KILL/5 或者 --retry 5 ~~~ ### 1.4 給可執行文件傳遞參數 ~~~ -- + 參數 例如啟動haproxy --exec $HAPROXY -- -f "$CONFIG 傳遞配置文件 ~~~ ~~~ start-stop-daemon --quiet --oknodo --start --pidfile "$PIDFILE" \ --exec $HAPROXY -- -f "$CONFIG" -D -p "$PIDFILE" \ $EXTRAOPTS || return 2 return 0 ~~~
                  <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>

                              哎呀哎呀视频在线观看