Fix command for checking hung puppet process

Previous version would result in running /bin/kill
with no parameter if the job ran while a young puppet
process was active.
This commit is contained in:
Keith Whyte 2020-06-28 11:32:15 +02:00
parent de974d4cd7
commit 695c794089

View file

@ -90,4 +90,4 @@ PYTHONPATH=$PYTHONPATH:/var/rhizomatica/rccn
0 4 * * * root /home/rhizomatica/bin/sqlite_backup_rotated.sh > /dev/null 2>&1
#Check for hung puppet process
*/20 * * * * root _PPID=$(pidof puppet) ; if [ "$?" -eq "0" ]; then /bin/kill $(ps -p $_PPID -o etimes,pid,cmd | awk '{if ($3$4$5 == "puppetagent:applying" && $1 >= 3600) print $2}'); fi
*/20 * * * * root _PPID=$(pidof puppet) ; if [ $? -eq 0 ]; then _RPID=$(ps -p $_PPID -o etimes,pid,cmd | awk '{if ($3$4$5 =="puppetagent:applying" && $1 >= 3600) print $2}') ; if [ -n "$_RPID" ]; then kill $_RPID; fi; fi