LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Deleted real server string patch

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Deleted real server string patch
From: "jarol1@xxxxxxxxx" <J.Libak@xxxxxxxxxx>
Date: Fri, 12 Jan 2007 19:18:47 +0100
Dung Nguyen wrote:
Real servers are "Deleted" due to two reasons:  1) due reload of the
configuration file after an update and 2) due to fail status check.

For organization that monitors the log files for actual node/resource
failure the second deletion reason is the only one they want to see.

Thus to distinguish between the two I am submitting the following patch. It
retains the string "Deleted real server" for the first reason.

And for the second reason, the string is modidifed to "Purged real server".

For organization that monitors the ldirectord log files, they can watch for
the string "Purged real server" and take appropriate action.

Note: The patch I am submitting is for version 1.120, the official version
that my organization is using.  It can easily be extracted and applied to
the latest version.

-Dung


[root@linux ldirectord]# diff -u ldirectord.v.1.120
ldirectord.v.1.120.patched --- ldirectord.v.1.120  2005-10-06 14:17:
38.000000000 -0700
+++ ldirectord.v.1.120.patched  2007-01-11 09:22:53.000000000 -0800
@@ -397,6 +397,7 @@
           @REAL
           @VIRTUAL
           $HOSTNAME
+        $REREAD_CFG

           $CRLF
);
@@ -412,6 +413,7 @@
$NEGOTIATETIMEOUT = 0;
$RUNPID           = "/var/run/ldirectord";
$QUIESCENT        = "yes";
+$REREAD_CFG       = 0;

$CRLF = "\x0d\x0a";

@@ -665,6 +667,7 @@
{
       @OLDVIRTUAL = @VIRTUAL;
       my %OLD_INSTANCE = %LD_INSTANCE;
+    $REREAD_CFG = 1;
       eval {
               &read_config();
               my %NEW_INSTANCE = %LD_INSTANCE;
@@ -688,6 +691,7 @@
               %LD_INSTANCE = %OLD_INSTANCE;
       }
       undef @OLDVIRTUAL;
+    $REREAD_CFG = 0;
}


@@ -2401,7 +2405,12 @@
        }
       else {
                &system_wrapper("$IPVSADM -d $ipvsadm_args");
-               &ld_log("Deleted $log_args");
+            if ($REREAD_CFG)  {
+                &ld_log("Purged $log_args");
+            }
+            else  {
+                   &ld_log("Deleted $log_args");
+            }
       }
}

[root@linux ldirectord]#
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://www.in-addr.de/mailman/listinfo/lvs-users

Perhaps you could also write a patch for distinguishing between adding a new server because it became online or because reload was triggered and new real server was defined.

Jaro


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