1
0

salt-daemon-watcher 543 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. #
  3. # Author: Bo Maryniuk <bo@suse.de>
  4. # Requires: yum install propcps
  5. #
  6. # Runs every minute from crontab,
  7. # checks salt-minion every 10 seconds.
  8. #
  9. # Use this with a following crontab:
  10. # * * * * * /path/to/this/script
  11. if [ "$1" != "--with-init" ]; then
  12. echo "This command is not used directly."
  13. exit 1;
  14. fi
  15. SHELL=/bin/sh
  16. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  17. for iter in {1..5}; do
  18. if [[ $(pgrep salt-minion) == "" ]]; then
  19. service salt-minion restart
  20. fi
  21. sleep 10;
  22. done
  23. true