mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Adding salt-minion watchdog for sysV systems (rhel6 and sles11)
This commit is contained in:
parent
db295f6f06
commit
4257ba5af9
1 changed files with 26 additions and 0 deletions
26
scripts/suse/watchdog/salt-daemon-watcher
Executable file
26
scripts/suse/watchdog/salt-daemon-watcher
Executable 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
|
Loading…
Add table
Reference in a new issue