2016-12-06 78 views
0

我們目前正在從shell腳本調用一個廚師食譜。廚師失敗並帶有自定義退出代碼,如下所示。但shell腳本獲取退出代碼爲1。所以我可以使用此自定義退出代碼使外殼腳本失敗。有沒有辦法將廚師退出代碼發送到shell

FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 5) 
+0

你如何終止你的shell腳本? –

+0

你怎麼稱呼你的食譜?在shell腳本中包裝廚師運行的目的是什麼?這聽起來像[XY問題](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) – Tensibai

回答

0

找到記錄特定的含義這是升技哈克,嘗試使用出口/ set_env PARAM ...

begin 
    <yourcode> 
rescue 
    env 'error_code' do 
     value '5' 
    end 
end 

然後訪問該ENV PARAM並將其刪除。

相關問題