LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: mysql not parsed in Ldirectord config.

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: mysql not parsed in Ldirectord config.
Cc: linux-ha-dev@xxxxxxxxxxxxxxxxxx
From: Horms <horms@xxxxxxxxxxxx>
Date: Thu, 12 May 2005 15:33:19 +0900
On Wed, May 11, 2005 at 11:09:23AM -0400, Purcocks, Graham wrote:
> Horm
> 
> Here is a patch, I changed from a memory file to a virtual temporary
> file. This is after appying both the mysql patch and the Postgres patch.
> 
> -----------------------------------------------------
> --- /usr/sbin/ldirectord        2005-04-28 17:13:40.000000000 +0000
> +++ ldirectord  2005-05-11 14:51:57.000000000 +0000
> @@ -2079,7 +2079,8 @@
> 
>         &ld_debug(2, "Checking ftp server=$$r{server} port=$port");
> 
> -       open(MEMORY,'>', \$memory);
> +       # Open temporary file
> +       open(TMP,'>', undef);
> 
>         unless ($ftp = Net::FTP->new("$$r{server}:$port",
>                         Timeout=>$$v{negotiatetimeout})) {
> @@ -2090,10 +2091,14 @@
>         $ftp->cwd("/");
>         $ftp->binary();
>         $ftp->pasv();
> -       $ftp->get("$$r{request}", *MEMORY);
> +       $ftp->get("$$r{request}", *TMP);
>         $ftp->quit();
> 
> -       close(MEMORY);
> +       seek TMP, 0, 0;
> +       select TMP;
> +       undef $/;
> +       $memory = <TMP>;
> +       close TMP;
> 
>         if ($memory =~ /$$r{receive}/) {
>                 service_set($v, $r, "up");
> --------------------------------------------------------- 
> 
> Is this OK?

That seems fine, I will go ahead and put it into CVS.
Bit weird that the memory FD broke at some stage.

-- 
Horms

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