Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## start with an init script
- - template "/etc/init.d/pt-heartbeat-#{port}" do
- - backup false
- - source "base_monitoring/pt-heartbeat.init.erb"
- - owner "root"
- - group "root"
- - mode 00755
- - variables(
- - :port => port
- - )
- + file "/etc/init.d/pt-heartbeat-#{port}" do
- + action :delete
- end
- ## then add a configuration file for each port
- - template "/etc/pt-heartbeat-#{port}" do
- - backup false
- - source "base_monitoring/pt-heartbeat.cfg.erb"
- - owner "root"
- - group "root"
- - mode 00700
- - variables(
- - :port => port,
- - :monuser => adminuser,
- - :monpass => adminpass
- - )
- + file "/etc/pt-heartbeat-#{port}" do
- + action :delete
- end
- ## Start the daemon
- service "pt-heartbeat-#{port}" do
- service_name "pt-heartbeat-#{port}"
- - action :start
- - subscribes :restart, "template[/etc/pt-heartbeat-#{port}]", :delayed
- + action [:disable, :stop]
- + only_if "test -f /etc/pt-heartbeat-#{port}"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement