Hey all,
Though I would share this with you. This script will do a force check on all the cabal services and verify that they are running. If one reports as "stopped" it will start it.
HowTo:
follow these commands as root:
cd /etc/cron.hourly/
touch cabal_checker
chmod +x cabal_checker
nano cabal_check
paste in the code and press ctrl + x then Y to save and Enter to overwrite.
If you want to test it just stop your server "service cabal stop" and run this script "./cabal_checker".
if all goes good it will start all services.
xircx
Though I would share this with you. This script will do a force check on all the cabal services and verify that they are running. If one reports as "stopped" it will start it.
Code:
#!/bin/sh
########################################
# This script was created by xircx #
# Hourly check for Cabal services #
########################################
#Temp file creator
touch /tmp/cabalstatus.tmp
touch /tmp/fname.tmp
#Status Verifier
service cabal status > /tmp/cabalstatus.tmp
while read s; do
if [[ $s == *stopped* ]];
then
echo "$s" | awk '{print $1}' > /tmp/fname.tmp
service `cat /tmp/fname.tmp` start
sleep 1
fi
done < /tmp/cabalstatus.tmp
#Clean Up
rm -rf /tmp/cabalstatus/tmp
rm -rf /tmp/fname.tmp
HowTo:
follow these commands as root:
cd /etc/cron.hourly/
touch cabal_checker
chmod +x cabal_checker
nano cabal_check
paste in the code and press ctrl + x then Y to save and Enter to overwrite.
If you want to test it just stop your server "service cabal stop" and run this script "./cabal_checker".
if all goes good it will start all services.
xircx