Adding salt-minion watchdog for sysV systems (rhel6 and sles11)

This commit is contained in:
Pablo Suárez Hernández 2017-06-08 16:22:53 +01:00
parent db295f6f06
commit 4257ba5af9

View file

@ -0,0 +1,26 @@
#!/bin/bash
#
# Author: Bo Maryniuk <bo@suse.de>
# Requires: yum install propcps
#
# Runs every minute from crontab,
# checks salt-minion every 10 seconds.
#
# Use this with a following crontab:
# * * * * * /path/to/this/script
if [ "$1" != "--with-init" ]; then
echo "This command is not used directly."
exit 1;
fi
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
for iter in {1..5}; do
if [[ $(pgrep salt-minion) == "" ]]; then
service salt-minion restart
fi
sleep 10;
done
true