From 8451d353241ccc03ecfb234bd5b38f9625fc80dd Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Tue, 3 Sep 2013 16:51:13 -0700 Subject: [PATCH] CLOUDSTACK-4601: Add PATH for cron job of check_heartbeat.sh Also fix a typo in the script template. --- patches/systemvm/debian/config/etc/init.d/cloud-early-config | 2 +- .../config/root/redundant_router/check_heartbeat.sh.templ | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index d847c2470a6..88ecc119b61 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -848,7 +848,7 @@ setup_redundant_router() { crontab -l|grep "check_heartbeat.sh" if [ $? -ne 0 ] then - (crontab -l; echo "*/1 * * * * $rrouter_bin_path/check_heartbeat.sh 2>&1 > /dev/null") | crontab + (crontab -l; echo -e "SHELL=/bin/bash\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n*/1 * * * * $rrouter_bin_path/check_heartbeat.sh 2>&1 > /dev/null") | crontab fi } diff --git a/patches/systemvm/debian/config/root/redundant_router/check_heartbeat.sh.templ b/patches/systemvm/debian/config/root/redundant_router/check_heartbeat.sh.templ index 7a980bdfb8c..1a390e69eea 100755 --- a/patches/systemvm/debian/config/root/redundant_router/check_heartbeat.sh.templ +++ b/patches/systemvm/debian/config/root/redundant_router/check_heartbeat.sh.templ @@ -22,7 +22,7 @@ then lasttime=$(cat [RROUTER_BIN_PATH]/keepalived.ts2) thistime=$(cat [RROUTER_BIN_PATH]/keepalived.ts) diff=$(($thistime - $lasttime)) - if [ $diff -lt 30] + if [ $diff -lt 30 ] then echo Keepalived process is dead! >> [RROUTER_LOG] service keepalived stop >> [RROUTER_LOG] 2>&1