Skip to content

Instantly share code, notes, and snippets.

@tsaavik
Created March 2, 2016 18:10
Show Gist options
  • Save tsaavik/cb8ca3153ff5afa15f6a to your computer and use it in GitHub Desktop.
Save tsaavik/cb8ca3153ff5afa15f6a to your computer and use it in GitHub Desktop.
# This restarts the agent every 30 days, to make sure its not hung
# And also checks that the lockfile isn't more then 1 hour old
check process puppet with pidfile /var/run/puppet/agent.pid
group system
start program = "/usr/sbin/service puppet start"
stop program = "/usr/sbin/service puppet stop"
if 5 restarts within 5 cycles then timeout
if uptime > 30 days then restart
check directory puppet-state-dir path /var/lib/puppet/state
depends on puppet
if timestamp > 1 hour then exec "/bin/rm -f /var/lib/puppet/state/agent_catalog_run.lock"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment