Advertisement
Guest User

Untitled

a guest
Jan 14th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. ## start with an init script
  2. - template "/etc/init.d/pt-heartbeat-#{port}" do
  3. - backup false
  4. - source "base_monitoring/pt-heartbeat.init.erb"
  5. - owner "root"
  6. - group "root"
  7. - mode 00755
  8. - variables(
  9. - :port => port
  10. - )
  11. + file "/etc/init.d/pt-heartbeat-#{port}" do
  12. + action :delete
  13. end
  14.  
  15. ## then add a configuration file for each port
  16. - template "/etc/pt-heartbeat-#{port}" do
  17. - backup false
  18. - source "base_monitoring/pt-heartbeat.cfg.erb"
  19. - owner "root"
  20. - group "root"
  21. - mode 00700
  22. - variables(
  23. - :port => port,
  24. - :monuser => adminuser,
  25. - :monpass => adminpass
  26. - )
  27. + file "/etc/pt-heartbeat-#{port}" do
  28. + action :delete
  29. end
  30.  
  31. ## Start the daemon
  32. service "pt-heartbeat-#{port}" do
  33. service_name "pt-heartbeat-#{port}"
  34. - action :start
  35. - subscribes :restart, "template[/etc/pt-heartbeat-#{port}]", :delayed
  36. + action [:disable, :stop]
  37. + only_if "test -f /etc/pt-heartbeat-#{port}"
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement