miah/chef-collectd — pull request #18 by ChrisLundquist (2013-02-15 23:21:09+00:00)
Title: [fix-centos-63] only try to kill a process that exists

This fixes the first run convergence under centos-63.

the stack trace looks like,

```
[2013-02-15T23:14:15+00:00] INFO: Retrying execution of execute[kill_collectdmon], 5 attempt(s) left
[2013-02-15T23:14:17+00:00] INFO: Retrying execution of execute[kill_collectdmon], 4 attempt(s) left
[2013-02-15T23:14:19+00:00] INFO: Retrying execution of execute[kill_collectdmon], 3 attempt(s) left
[2013-02-15T23:14:21+00:00] INFO: Retrying execution of execute[kill_collectdmon], 2 attempt(s) left
[2013-02-15T23:14:23+00:00] INFO: Retrying execution of execute[kill_collectdmon], 1 attempt(s) left
[2013-02-15T23:14:25+00:00] INFO: Retrying execution of execute[kill_collectdmon], 0 attempt(s) left

================================================================================

Error executing action `run` on resource 'execute[kill_collectdmon]'

================================================================================

Mixlib::ShellOut::ShellCommandFailed

------------------------------------

Expected process to exit with [0], but received '1'
---- Begin output of kill -TERM $(pidof collectdmon) ----
STDOUT:
STDERR: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
---- End output of kill -TERM $(pidof collectdmon) ----
Ran kill -TERM $(pidof collectdmon) returned 1

Resource Declaration:

---------------------

# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/collectd/recipes/_install_from_package.rb

27: execute 'kill_collectdmon' do
28: command 'kill -TERM $(pidof collectdmon)'
29: user 'root'
30: action :nothing
31: retries 6
32: end
33:

Compiled Resource:

------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/collectd/recipes/_install_from_package.rb:27:in `from_file'

execute("kill_collectdmon") do
action [:nothing]
retries 0
retry_delay 2
command "kill -TERM $(pidof collectdmon)"
backup 5
returns 0
user "root"
cookbook_name :collectd
recipe_name "_install_from_package"
end
```