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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ### 顯示命令的輸出結果 > Computer says no. > > — Little Britain 一個問題的詳細反饋會對解決問題有幫助。當你使用 exec 資源在節點上執行命令時, 并不總能輕易地找出其為何沒有正確執行。如果命令返回一個非零的退出狀態,Puppet 就會返回類似如下的錯誤消息: ``` err: /Stage[main]//Node[cookbook]/Exec[this-will-fail]/returns: change from notrun to 0 failed: /bin/ls file-that-doesnt-exist returned 2 instead of one of [0] at /etc/puppet/manifests/nodes.pp:10 ``` 通常我們希望看到執行失敗時的輸出,而不僅僅是一個退出的狀態碼。 你可以使用 logoutput 參數實現。 #### 操作步驟 用 logoutput 參數定義如下的 exec 資源: ``` exec { "this-will-fail": command => "/bin/ls file-that-doesnt-exist", logoutput => on_failure, } ``` #### 工作原理 現在,如果命令執行失敗,Puppet 同時會打印命令的錯誤輸出: ``` notice: /Stage[main]//Node[cookbook]/Exec[this-will-fail]/returns: /bin/ ls: cannot access file-that-doesnt-exist: No such file or directory err: /Stage[main]//Node[cookbook]/Exec[this-will-fail]/returns: change from notrun to 0 failed: /bin/ls file-that-doesnt-exist returned 2 instead of one of [0] at /etc/puppet/manifests/nodes.pp:11 ``` #### 更多用法 你可以使用如下的配置為所有的 exec 資源設置打印錯誤輸出的默認值: ``` Exec { logoutput => on_failure, } ``` 若不管命令執行成功與否,你都想看到其輸出,需使用如下的配置: ``` logoutput => true, ```
                  <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>

                              哎呀哎呀视频在线观看