Run puppet sync with timeout(1) if it's installed
authorPeter Palfrader <peter@palfrader.org>
Wed, 26 Aug 2009 08:43:23 +0000 (10:43 +0200)
committerPeter Palfrader <peter@palfrader.org>
Wed, 26 Aug 2009 08:43:23 +0000 (10:43 +0200)
files/etc/cron.d/dsa-puppet-stuff

index 72724ee..f3aa1a5 100644 (file)
@@ -1,3 +1,3 @@
 SHELL=/bin/bash
 @hourly  root [ ! -d /var/cache/dsa ] || touch /var/cache/dsa/cron.alive
-34 */4 * * * root [ ! -x /usr/sbin/puppetd ] || ( sleep $(( $RANDOM \% 3600 )) && /usr/sbin/puppetd --factsync -o --no-daemonize )
+34 */4 * * * root if [ -x /usr/sbin/puppetd ]; then sleep $(( $RANDOM \% 3600 )); if [ -x /usr/bin/timeout ]; then TO="timeout 3600"; else TO=""; fi; $TO /usr/sbin/puppetd --factsync -o --no-daemonize ; fi