Created
February 6, 2011 22:14
-
-
Save thbar/813770 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby_block "Verify running processed" do | |
block do | |
missing_processes = [] | |
[ | |
"jetty", | |
"nginx", | |
"mongodb-#{node[:mongodb][:version]}", | |
"redis-#{node[:redis][:version]}" | |
].each do |process| | |
Chef::Log.debug("Checking process #{process}") | |
grep_name = process.gsub(/(.)(.*)/,"[\\1]\\2") | |
if `ps -A -o command | grep "#{grep_name}"`.empty? | |
Chef::Log.error("Missing process #{process}!!!") | |
missing_processes << process | |
end | |
end | |
raise "Missing processed - #{missing_processes.inspect}" unless missing_processes.empty? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment