mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 11351: Add checkrouter.sh.templ
Also modify ipassoc.sh to use checkrouter.sh
This commit is contained in:
parent
b007e24e59
commit
d3b0f04877
@ -345,6 +345,7 @@ setup_redundant_router() {
|
|||||||
cp /root/redundant_router/backup.sh.templ $rrouter_bin_path/backup.sh
|
cp /root/redundant_router/backup.sh.templ $rrouter_bin_path/backup.sh
|
||||||
cp /root/redundant_router/fault.sh.templ $rrouter_bin_path/fault.sh
|
cp /root/redundant_router/fault.sh.templ $rrouter_bin_path/fault.sh
|
||||||
cp /root/redundant_router/primary-backup.sh.templ $rrouter_bin_path/primary-backup.sh
|
cp /root/redundant_router/primary-backup.sh.templ $rrouter_bin_path/primary-backup.sh
|
||||||
|
cp /root/redundant_router/checkrouter.sh.templ /root/checkrouter.sh
|
||||||
sed -i "s/\[ROUTER_ID\]/$NAME/g" /etc/keepalived/keepalived.conf
|
sed -i "s/\[ROUTER_ID\]/$NAME/g" /etc/keepalived/keepalived.conf
|
||||||
sed -i "s/\[ROUTER_IP\]/$GUEST_GW\/$GUEST_CIDR_SIZE/g" /etc/keepalived/keepalived.conf
|
sed -i "s/\[ROUTER_IP\]/$GUEST_GW\/$GUEST_CIDR_SIZE/g" /etc/keepalived/keepalived.conf
|
||||||
sed -i "s/\[BOARDCAST\]/$GUEST_BRD/g" /etc/keepalived/keepalived.conf
|
sed -i "s/\[BOARDCAST\]/$GUEST_BRD/g" /etc/keepalived/keepalived.conf
|
||||||
@ -366,6 +367,7 @@ setup_redundant_router() {
|
|||||||
sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/backup.sh
|
sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/backup.sh
|
||||||
sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/fault.sh
|
sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/fault.sh
|
||||||
sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/primary-backup.sh
|
sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/primary-backup.sh
|
||||||
|
sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" /root/checkrouter.sh
|
||||||
chmod a+x $rrouter_bin_path/*.sh
|
chmod a+x $rrouter_bin_path/*.sh
|
||||||
|
|
||||||
sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived
|
sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived
|
||||||
|
|||||||
@ -213,7 +213,7 @@ op=""
|
|||||||
is_master=0
|
is_master=0
|
||||||
is_redundant=0
|
is_redundant=0
|
||||||
if_keep_state=0
|
if_keep_state=0
|
||||||
sudo ls /root/keepalived.log > /dev/null 2>&1
|
grep "redundant_router=1" /var/cache/cloud/cmdline > /dev/null
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
is_redundant=1
|
is_redundant=1
|
||||||
|
|||||||
24
patches/systemvm/debian/config/root/redundant_router/checkrouter.sh.templ
Executable file
24
patches/systemvm/debian/config/root/redundant_router/checkrouter.sh.templ
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source /root/func.sh
|
||||||
|
|
||||||
|
lock="rrouter"
|
||||||
|
locked=$(getLockFile $lock)
|
||||||
|
if [ "$locked" != "1" ]
|
||||||
|
then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
bumped="Bumped: NO"
|
||||||
|
if [ -e /tmp/rrouter_bumped ]
|
||||||
|
then
|
||||||
|
bumped="Bumped: YES"
|
||||||
|
fi
|
||||||
|
|
||||||
|
stat=`tail -n 1 [RROUTER_LOG] | grep "Status"`
|
||||||
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "$stat&$bumped"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unlock_exit $? $lock $locked
|
||||||
Loading…
x
Reference in New Issue
Block a user