Ниже приведен мой рецепт установки монита. Я запускаю шеф-клиент каждые 60 секунд для отладки.
Шеф-повар, если перезапустить монитор каждые 60 секунд. Нет, я остановлю это? Я думал, что шеф-повар перезагрузится, если сменить темплет.
[Fri, 30 Mar 2012 06:12:18 +0000] INFO: Processing package[monit] action install (monit::default line 5)
[Fri, 30 Mar 2012 06:12:18 +0000] INFO: Processing service[monit] action enable (monit::default line 9)
[Fri, 30 Mar 2012 06:12:18 +0000] INFO: Processing service[monit] action start (monit::default line 9)
[Fri, 30 Mar 2012 06:12:18 +0000] INFO: Processing template[monitrc] action create (monit::default line 14)
[Fri, 30 Mar 2012 06:12:18 +0000] INFO: template[monitrc] mode changed to 644
[Fri, 30 Mar 2012 06:12:18 +0000] INFO: template[monitrc] sending restart action to service[monit] (immediate)
[Fri, 30 Mar 2012 06:12:18 +0000] INFO: Processing service[monit] action restart (monit::default line 9)
[Fri, 30 Mar 2012 06:12:22 +0000] INFO: service[monit] restarted
[Fri, 30 Mar 2012 06:12:22 +0000] INFO: Processing template[monitstart] action create (monit::default line 25)
package "monit" do
action :install
end
service "monit" do
supports :status => true, :restart => true, :start => true,:stop => true
action [ :enable, :start ]
end
template "monitrc" do
path "/etc/monit/monitrc"
source "monitrc.erb"
owner "root"
group "root"
mode "0644"
#notifies :restart, resources(:service => "monit")
#notifies :restart, "service[monit]"
notifies :restart, resources(:service => "monit"), :immediate
end
template "monitstart" do
path "/etc/default/monit"
source "monit.erb"
owner "root"
group "root"
mode "0644"
notifies :restart, "service[monit]"
#notifies :restart, resources(:service => "monit"), :immediate
end