]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
I'm getting tired of finding stuck cron daemons
authorStephen Gran <steve@lobefin.net>
Fri, 12 Jun 2009 16:29:52 +0000 (17:29 +0100)
committerStephen Gran <steve@lobefin.net>
Fri, 12 Jun 2009 16:29:52 +0000 (17:29 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
files/etc/cron.d/dsa-puppet-stuff [new file with mode: 0644]
modules/debian-org/manifests/init.pp
modules/monit/files/puppet
modules/samhain/templates/samhainrc.erb

diff --git a/files/etc/cron.d/dsa-puppet-stuff b/files/etc/cron.d/dsa-puppet-stuff
new file mode 100644 (file)
index 0000000..0d16c2c
--- /dev/null
@@ -0,0 +1 @@
+@hourly  root [ ! -d /var/cache/dsa ] || touch /var/cache/dsa/cron.alive
index de1b4a6a6b927b275efc7ee1193637cc3293d4bd..ae9e504c95b2ef35bc59c705d11eb19c902c6cd2 100644 (file)
@@ -1,6 +1,7 @@
 class debian-org {
    package { "userdir-ldap": ensure => installed;
              "zsh": ensure => installed;
+             "cron": ensure => installed;
              "apt-utils": ensure => installed;
              "tcsh": ensure => installed;
              "pdksh": ensure => installed;
@@ -62,6 +63,10 @@ class debian-org {
       "/etc/logrotate.d/syslog-ng":
              source => "puppet:///files/etc/logrotate.d/syslog-ng",
              ;
+      "/etc/cron.d/dsa-puppet-stuff":
+             source => "puppet:///files/etc/cron.d/dsa-puppet-stuff",
+             require => Package["cron"]
+             ;
    }
    case $hostname {
         handel: {
index ab3fe14ed75bc65eab41bcb76b4e320a1ec41389..589ecbcf1957ea0badbb42b8b32252dae7d75c96 100644 (file)
@@ -14,3 +14,12 @@ check file puppetstate
     if timestamp > 90 minutes for 9 cycles then exec "/etc/init.d/puppet stop"
     depends on puppetd
 
+check process cron with pidfile /var/run/crond.pid
+    start program = "/etc/init.d/cron start"
+    stop program  = "/etc/init.d/cron stop"
+    if 5 restarts within 5 cycles then timeout
+
+check file cronalive
+    with path /var/cache/dsa/cron.alive
+    if timestamp > 120 minutes for 5 cycles then exec "/etc/init.d/cron stop"
+    depends on crond
index 861e75a80b5e01477427a26e603780f49d8e6c34..78fad9c146d40acecb97d472721884e8c8d4db7c 100644 (file)
@@ -299,6 +299,7 @@ file=/etc/pam.d/sudo
 file=/etc/monit/monitrc
 file=/etc/monit/monit.d/01puppet
 file=/etc/monit/monit.d/00debian.org
+file=/etc/cron.d/dsa-puppet-stuff
 <%= extrafiles=""
 case fqdn 
 when "spohr.debian.org": extrafiles="file=/etc/nagios3/puppetconf.d/auto-hostgroups.cfg