关于为什么厨师中的这个片段失败的任何想法?
bash "Stopping service" do
user #{user}
cwd "~/"
code <<-EOH
killall -q java
EOH
end
下面的堆栈跟踪:
================================================================================
Error executing action `run` on resource 'bash[Stopping service]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20140227-3331-1te6gkd-0" ----
STDOUT:
STDERR:
---- End output of "bash" "/tmp/chef-script20140227-3331-1te6gkd-0" ----
Ran "bash" "/tmp/chef-script20140227-3331-1te6gkd-0" returned 1
Resource Declaration:
---------------------
# In /home/mcamilleri/cookbooks/stuff/recipes/deploy_jar.rb
13: bash "Stopping service" do
14: user #{user}
15: cwd "~/"
16: code <<-EOH
17: killall -q java
18: EOH
19: end
20:
Compiled Resource:
------------------
# Declared in /home/mcamilleri/cookbooks/stuff/recipes/deploy_jar.rb:13:in `from_file'
bash("Stopping service") do
cookbook_name :stuff
action "run"
retry_delay 2
recipe_name "deploy_jar"
interpreter "bash"
code " killall -q java\n"
backup 5
retries 0
command "\"bash\" \"/tmp/chef-script20140227-3331-1te6gkd-0\""
cwd "~/"
returns 0
end
Running handlers:
[2014-02-27T05:16:17-08:00] ERROR: Running exception handlers
Running handlers complete
[2014-02-27T05:16:17-08:00] ERROR: Exception handlers complete
[2014-02-27T05:16:17-08:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 0.629887 seconds
[2014-02-27T05:16:17-08:00] ERROR: bash[Stopping service] (stuff::deploy_jar line 13) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20140227-3331-1te6gkd-0" ----
STDOUT:
STDERR:
---- End output of "bash" "/tmp/chef-script20140227-3331-1te6gkd-0" ----
Ran "bash" "/tmp/chef-script20140227-3331-1te6gkd-0" returned 1
[2014-02-27T05:16:17-08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)