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.
From: "Purcocks, Graham" <grahamp@xxxxxxxxxxxxx>
Date: Wed, 11 May 2005 11:09:23 -0400
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?

Graham


-----Original Message-----
From: lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Horms
Sent: 10 May 2005 09:53
To: LinuxVirtualServer.org users mailing list.
Subject: Re: mysql not parsed in Ldirectord config.

On Mon, May 09, 2005 at 04:06:05PM +0100, Graham David Purcocks
M.A.(Oxon.) wrote:
> Horms/et al.
> 
> I don't think FTP full check works. I have found that Net::FTP::get
> won't write to a memory file. It uses syswrite and that doesn't appear
> to like a fileno(-1) which the memory file is associated with. You can
> print to the file handle but not syswrite.
> 
> Can anyone else confirm whether they have FTP negotiate connection
type
> working in Ultramonkey 3?
> 
> Will try to fix, using a memory file is neat but not if Net::FTP won't
> play ball.

I have had it working in the past, but your reasoning seems sound.
Let me know if you come up with a patch.

-- 
Horms


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