Just stick this code snippet at the bottom of the
deploy.rb file.
# Redefine the application server controls to use monit.
namespace :deploy do
%W(start stop restart).each do |event|
desc "#{event} using Monit"
task event, :except => { :no_release => true } do
sudo "/usr/sbin/monit -g #{application} #{event} all"
end
end
end

2 comments:
Hi.
What's your Monit user? I would not want to use root as my capistrano user and I'm not sure that I can chown Monit to my cap user...
My monit runs as a root daemon, which is the only user it can effectively run as so that it can deal with processes running under different usernames.
My mongrels run under a different username and monit restarts them under that username - as defined in the configuration files.
Remember that the commands shown are just an instruction to the monit daemon to restart processes it knows about.
Post a Comment