# restart puppet once in a while and randomly delay the restart between 0 and 32 minutes -> splay puppetmaster hammering
-0 22 * * */2 root /bin/bash -c "sleep `echo $RANDOM/1000*60 | bc` && /etc/init.d/puppet restart" > /dev/null
+0 22 * * */2 root /usr/local/sbin/check-puppetd.sh restart > /dev/null
}
cron { "puppetd-check":
- command => "/usr/local/sbin/check-puppetd.sh > /dev/null 2>&1",
+ command => "/usr/local/sbin/check-puppetd.sh > /dev/null",
user => root,
hour => "*/1",
minute => "0",
# check if puppet is running
#
+PATH="$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
PID="/var/run/puppet/<%= puppet_agent_name %>.pid"
INIT="/etc/init.d/puppet"
$INIT start
}
-if [ ! -f "$PID" ]; then
+if [ "$1" == "restart" ]; then
+ puppet_restart
+elif [ ! -f "$PID" ]; then
puppet_start
else
running="$(ps $(cat $PID) &> /dev/null)"