From 214c859d2a910daa75c450f3eece5c3c130479f8 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 13 Jun 2012 00:23:48 +0200 Subject: [PATCH] have our cronjob kill -9 puppet if it runs too long --- modules/debian-org/files/dsa-puppet-stuff.cron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/debian-org/files/dsa-puppet-stuff.cron b/modules/debian-org/files/dsa-puppet-stuff.cron index 9d2204bf..259de9e2 100644 --- a/modules/debian-org/files/dsa-puppet-stuff.cron +++ b/modules/debian-org/files/dsa-puppet-stuff.cron @@ -5,5 +5,5 @@ SHELL=/bin/bash @hourly root [ ! -d /var/cache/dsa ] || touch /var/cache/dsa/cron.alive -34 */4 * * * root if [ -x /usr/sbin/puppetd ]; then sleep $(( $RANDOM \% 3600 )); if [ -x /usr/bin/timeout ]; then TO="timeout 3600"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.dsa-puppet-stuff > "$tmp" && $TO /usr/sbin/puppetd -o --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi +34 */4 * * * root if [ -x /usr/sbin/puppetd ]; then sleep $(( $RANDOM \% 3600 )); if [ -x /usr/bin/timeout ]; then TO="timeout 3600 --kill-after=900"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.dsa-puppet-stuff > "$tmp" && $TO /usr/sbin/puppetd -o --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi @daily root find /var/lib/puppet/clientbucket/ -type f -mtime +30 -atime +30 -exec rm {} \+ -- 2.39.2