Created
March 10, 2011 21:06
-
-
Save pcreux/864929 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
#... | |
monit_process "postfix" do | |
pid_file "/var/spool/postfix/pid/master.pid" | |
executable "/etc/init.d/postfix" | |
end | |
#... |
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
# /etc/init.d/* scripts always have to be run as 'root'. These scripts take care of | |
# launching processes with the right user (www-data, aptproxy, nagios ...) | |
define :monit_process, :pid_file => nil, :executable => nil, :user => 'root', :group => nil do | |
execute "monit_reload" do | |
command "/usr/sbin/monit reload" | |
end | |
template "/etc/monit/conf.d/#{params[:name]}.monitrc" do | |
source "monit_process.monitrc.erb" | |
cookbook "monit" | |
variables(params) | |
notifies :run, resources(:execute => "monit_reload") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment