LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] LVSSyncDaemonSwap syncid patch

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] LVSSyncDaemonSwap syncid patch
From: Sebastien Termeau <st@xxxxxxxxxxxxxxxx>
Date: Thu, 6 Aug 2009 14:24:26 +0200
Dear LVS users,

Here is a patch to LVSSyncDaemonSwap.
It adds a syncid parameter allowing you to specify the ipvsadm daemon syncid
in the haresources file like this :
   LVSSyncDaemonSwap::master::eth0::<sync_id>

The only drawback is that you have to specify the mcast interface in order
to use the syncid parameter.
Your comments are most welcome.
Regards

Sebastien

--- LVSSyncDaemonSwap.orig    2009-08-06 14:36:33.000000000 +0200
+++ LVSSyncDaemonSwap    2009-08-06 15:01:34.000000000 +0200
@@ -11,7 +11,8 @@
 #       Please note that as of 2.4.29, this is no longer needed
 #       as both the master and backup daemon can run simultaneously
 #
-#        usage: $0 {master|backup} {interface}
{start|stop|status|monitor|cleanup}
+#        usage: $0 {master|backup} {interface {syncid}}
{start|stop|status|monitor|cleanup}
+#        If you want to specify the syncid, you have to specify the mcast
interface first
 #
 #        The first argument, master or backup, is the YING.
 #        The YANG is internally calculated to be which ever or master and
@@ -36,7 +37,7 @@
 exec_prefix=/usr
 . /etc/ha.d/shellfuncs

-USAGE="usage: $0 {master|backup} {interface}
{start|stop|status|monitor|cleanup}\n\nNote: $0 only works on Linux";
+USAGE="usage: $0 {master|backup} {interface {syncid}}
{start|stop|status|monitor|cleanup}\n\nNote: $0 only works on Linux";

 # This is consistent with ldirectord's behaviour
 # Except that this script does not have a debug mode
@@ -115,7 +116,7 @@
         ha_log "info: ipvs_sync$YANG down"
     fi

-    run_ipvsadm --start-daemon $YING --mcast-interface=$IFACE || return $?
+    run_ipvsadm --start-daemon $YING --mcast-interface=$IFACE
--syncid=$SYNCID || return $?

     ha_log "info: ipvs_sync$YING up"
     return 0
@@ -157,8 +158,7 @@
   echo -e $USAGE >&2
 }

-if
-    [ $# -lt 2 -o $# -gt 3 ]
+if [ $# -lt 2 -o $# -gt 4 ]
 then
     usage
     exit 1
@@ -166,12 +166,19 @@

 PS=$(ps ax | grep " \[ipvs[ _]sync")

-if [ $# -eq 3 ]
+if [ $# -eq 4 ]
+then
+    CMD=$4
+    SYNCID=$3
+    IFACE=$2
+elif [ $# -eq 3 ]
 then
     CMD=$3
+    SYNCID=0
     IFACE=$2
 else
     CMD=$2
+    SYNCID=0
     IFACE=eth0
 fi
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

<Prev in Thread] Current Thread [Next in Thread>