lib/cap_recipes/tasks/play.rb in uhl-cap-recipes-0.1.6 vs lib/cap_recipes/tasks/play.rb in uhl-cap-recipes-0.1.7

- old
+ new

@@ -54,10 +54,23 @@ else servers.split(/[,\s]+/) end end + namespace :nrpe do + desc "stop nagios nrpe service" + task :stop do + run "[ -e /etc/init.d/nrpe ] && sudo /etc/init.d/nrpe stop" + end + + desc "start nagios nrpe service" + task :start do + run "[ -e /etc/init.d/nrpe ] && sudo /etc/init.d/nrpe start" + run "[ -e /etc/init.d/nrpe ] && sudo /etc/init.d/nrpe reload" + end + end + namespace :play do desc "start service" task :start do sudo "/etc/init.d/#{service_name} start" @@ -66,15 +79,13 @@ # until api_status # api_status = capture("echo `netstat -tln | grep 8080`") # sleep 60 # end # puts "API Started successfully." - run "[ -e /etc/init.d/nrpe ] && sudo /etc/init.d/nrpe start" end desc "stop service" task :stop do - run "[ -e /etc/init.d/nrpe ] && sudo /etc/init.d/nrpe stop" sudo "/etc/init.d/#{service_name} stop" end desc "stop and start service" task :restart do