LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: ldirectord tests for custom apps

To: "Horms" <horms@xxxxxxxxxxxx>
Subject: Re: ldirectord tests for custom apps
Cc: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
From: "Patrick LeBoutillier" <patl@xxxxxxxxxxxx>
Date: Tue, 30 Nov 2004 07:49:49 -0600 (CST)
> Thanks, its a bit hard to read in its current form,
> could you send a unified diff. (use diff -u).
> That would help immensely.

> Thanks


Here goes (I also included as an attachment since the lines are quite long):

--- ldirectord.ori    2004-11-22 14:59:50.060384488 -0500
+++ ldirectord    2004-11-22 16:22:45.363023520 -0500
@@ -771,8 +771,8 @@
                 } elsif ($rcmd =~ /^service\s*=\s*(.*)/) {
                     lc($1);
                     $1 =~ /(\w+)/ && ($1 eq "http" || $1 eq "https" || $1
eq "ldap"
-                        || $1 eq "ftp" || $1 eq "none" || $1 eq "smtp" ||
$1 eq "pop" || $1 eq "imap" || $1 eq "nntp" || $1 eq "dns")
-                        or &config_error($line, "service must be http,
https, ftp, smtp, pop, imap, ldap, nntp, dns or none");
+                        || $1 eq "ftp" || $1 eq "none" || $1 eq "smtp" ||
$1 eq "pop" || $1 eq "imap" || $1 eq "nntp" || $1 eq "dns" || defined
&{"check_$1"})
+                        or &config_error($line, "service must be http,
https, ftp, smtp, pop, imap, ldap, nntp, dns, none or a check_<service>
function must exist");
                     $vsrv{service} = $1;
                     if($vsrv{service} eq "ftp" and
                             $vsrv{login} eq "") {
@@ -865,6 +865,11 @@
                 or &config_error($line,
                         "quiescent must be 'yes' or 'no'");
             $QUIESCENT = $1;
+        } elsif ($_ =~ /^plugins\s*=\s*(.*)/) {
+            (-r $1)
+                or &config_error($line,
+                        "plugins must be a readeable file containing perl
code");
+            require $1 ;
         } else {
             if ($_ =~ /^timeout\s*=\s*(.*)/) {
                 &config_error($line,
@@ -1543,6 +1548,9 @@
                         $$r{num_connects} = 0 if (check_nntp($v, $r));
                     } elsif ($$v{service} eq "dns") {
                         $$r{num_connects} = 0 if (check_dns($v, $r));
+                    } elsif (defined &{"check_$$v{service}"}) {
+                        no strict 'refs' ;
+                        $$r{num_connects} = 0 if
(&{"check_$$v{service}"}($v, $r));
                     } else {
                         $$r{num_connects} = 0 if (check_none($v, $r));
                     }
@@ -2059,7 +2067,7 @@
 #       it belongs to.
 # return: none

-sub service_set()
+sub service_set
 {
     my ($v, $r, $state, $force) = @_;


-- 
=====================
Patrick LeBoutillier
Laval, Quebec, Canada




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