Amanda-Users

Re: Backup issues with OpenBSD 4.5 machines

2009-08-24 14:17:48
Subject: Re: Backup issues with OpenBSD 4.5 machines
From: Jean-Louis Martineau <martineau AT zmanda DOT com>
To: stan <stanb AT panix DOT com>
Date: Mon, 24 Aug 2009 14:01:09 -0400
This bug can't be fixed until we understand it.

Ask on a OpenBSD list how a write to a blocking pipe can return EAGAIN.
Or the pipe semantics changed and they don't default to blocking.

You can also try the attached, it check the pipe are opened in blocking mode.

Jean-Louis

stan wrote:
On Fri, Aug 21, 2009 at 01:23:29PM -0600, John Hein wrote:
stan wrote at 13:56 -0400 on Aug 21, 2009:
 > OK, I reproduced the failure with only a crossover cable between the test
 > client and the Amanda Master:

Just because you're using a crossover cable doesn't rule out firewall
or other such socket level interference.  I'm not saying that's your
problem, but using a crossover cable doesn't rule it out.

Fair enough, but I think we can rule that out in this case. First, I
control the 2 computersin question. The Master backus up 55 machines a day
taht consist of a diverse nix of OS'es, and Amanda versions. It's a Linux
machine, and I am not running a firwall on it. The client is an OpenBSD
machine. I use these for my firewalls, so I am familiar with configuring
firewalls on them, Doing so requires (as a minimum) running pf. I am not
running pf on the test machine at all.

I am not certain whether the sendbackup executable, or amandad opens the
port on the client side. My guess is that it is not suceding in doing this.
Thus when the Master tries to connect to it, there is no port for it to
connect to.


Index: amandad-src/amandad.c
===================================================================
--- amandad-src/amandad.c       (revision 2110)
+++ amandad-src/amandad.c       (working copy)
@@ -1517,6 +1517,7 @@
     struct active_service *as;
     pid_t pid;
     int newfd;
+    int r;
 
     assert(security_handle != NULL);
     assert(cmd != NULL);
@@ -1535,15 +1536,40 @@
            error(_("pipe: %s\n"), strerror(errno));
            /*NOTREACHED*/
        }
+       r = fcntl(data_read[i][0], F_GETFL, 0);
+       if (r & O_NONBLOCK) {
+           error(_("data_read[%d][0] is non blocking"), i);
+       }
+       r = fcntl(data_read[i][1], F_GETFL, 0);
+       if (r & O_NONBLOCK) {
+           error(_("data_read[%d][1] is non blocking"), i);
+       }
+
        if (pipe(data_write[i]) < 0) {
            error(_("pipe: %s\n"), strerror(errno));
            /*NOTREACHED*/
        }
+       r = fcntl(data_write[i][0], F_GETFL, 0);
+       if (r & O_NONBLOCK) {
+           error(_("data_write[%d][0] is non blocking"), i);
+       }
+       r = fcntl(data_write[i][1], F_GETFL, 0);
+       if (r & O_NONBLOCK) {
+           error(_("data_write[%d][1] is non blocking"), i);
+       }
     }
     if (pipe(data_write[STDERR_PIPE]) < 0) {
        error(_("pipe: %s\n"), strerror(errno));
        /*NOTREACHED*/
     }
+    r = fcntl(data_write[STDERR_PIPE][0], F_GETFL, 0);
+    if (r & O_NONBLOCK) {
+       error(_("data_write[%d][0] is non blocking"), STDERR_PIPE);
+    }
+    r = fcntl(data_write[STDERR_PIPE][1], F_GETFL, 0);
+    if (r & O_NONBLOCK) {
+       error(_("data_write[%d][1] is non blocking"), STDERR_PIPE);
+    }
 
     switch(pid = fork()) {
     case -1:
<Prev in Thread] Current Thread [Next in Thread>