[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ha-dev
Subject:    [Linux-ha-dev] Re: mysql not parsed in Ldirectord config.
From:       Horms <horms () verge ! net ! au>
Date:       2005-05-12 6:33:19
Message-ID: 20050512063316.GV21624 () verge ! net ! au
[Download RAW message or body]

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
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic