Amanda-Users

problems using amanda with xinetd

2003-06-09 14:13:20
Subject: problems using amanda with xinetd
From: Mike Eldridge <diz AT hiphopanonymous DOT org>
To: amanda-users AT amanda DOT org
Date: Mon, 9 Jun 2003 13:10:19 -0500
all,

i'm having serious problems getting amanda to function on a server
running xinetd.  the amanda setup on this particular box runs fine with
inetd, but i cannot get xinetd to cooperate with me.

the skinny:

    upon amcheck, xinetd attempts to spawn 25 amandad processes,
    generating 25 pairs of START/FAIL lines in my logs.  after the 25
    attempts, xinetd disables the service.

    amanda functions as expected under inetd.

the error reported by amcheck:

    WARNING: copernicus.sheergenius.com: selfcheck request timed out.  Host 
down?

my xinetd entry:

    service amanda
    {
        protocol        = udp
        socket_type     = dgram
        wait            = yes
        user            = amanda
        group           = disk
        groups          = yes
        server          = /usr/local/libexec/amandad
        server_args     = amandad
    }

my .amandahosts file has appropriate entries and is 0600.  stracing
xinetd gives me much information, but no leads.  strace output,
verbatim, from xinetd's socket() call amandad's exit() call, follows:

    * note that, for tracing purposes, i changed user/group to root/root
      for the service so that ptrace() would attach to the new process.
      enlighten me if there is a safe way to follow processes across
      forks() that are setuid() under linux.

    * aaa.bbb.ccc.ddd references the amanda server in question;
      www.xxx.yyy.zzz references the dns server

    [pid 27743] socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 5
    [pid 27743] fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
    [pid 27743] setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
    [pid 27743] bind(5, {sin_family=AF_INET, sin_port=htons(10080), 
sin_addr=inet_addr("0.0.0.0")}}, 16) = 0
    [pid 27743] socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 6
    [pid 27743] fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
    [pid 27743] setsockopt(6, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
    [pid 27743] bind(6, {sin_family=AF_INET, sin_port=htons(901), 
sin_addr=inet_addr("0.0.0.0")}}, 16) = 0
    [pid 27743] listen(6, 7)                = 0 
    [pid 27743] chdir("/")                  = 0
    [pid 27743] time([1055179791])          = 1055179791
    [pid 27743] getpid()                    = 27743
    [pid 27743] rt_sigaction(SIGPIPE, {0x401592c0, [], 0x4000000}, {SIG_IGN}, 
8) = 0     [pid 27743] send(7, "<29>Jun  9 12:29:51 xinetd[27743"..., 108, 0) = 
108
    [pid 27743] rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0
    [pid 27743] time([1055179791])          = 1055179791
    [pid 27743] getpid()                    = 27743
    [pid 27743] rt_sigaction(SIGPIPE, {0x401592c0, [], 0x4000000}, {SIG_IGN}, 
8) = 0
    [pid 27743] send(7, "<29>Jun  9 12:29:51 xinetd[27743"..., 72, 0) = 72
    [pid 27743] rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0
    [pid 27743] time([1055179791])          = 1055179791
    [pid 27743] getpid()                    = 27743
    [pid 27743] rt_sigaction(SIGPIPE, {0x401592c0, [], 0x4000000}, {SIG_IGN}, 
8) = 0
    [pid 27743] send(7, "<29>Jun  9 12:29:51 xinetd[27743"..., 72, 0) = 72
    [pid 27743] rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0
    [pid 27743] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
    [pid 27743] select(7, [3 5 6], NULL, NULL, NULL <unfinished ...>
    [pid 27742] <... nanosleep resumed> {3, 0}) = 0
    [pid 27742] _exit(0)                    = ?
    <... select resumed> )                  = 1 (in [5])
    recvfrom(5, "A", 1, MSG_PEEK, {sin_family=AF_INET, sin_port=htons(647), 
sin_addr=inet_addr("aaa.bbb.ccc.ddd")}}, [16]) = 1
    time(NULL)                              = 1055179822
    fork()                                  = 27764
    [pid 27764] rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_IGN}, 8) = 0
    [pid 27764] rt_sigaction(SIGTSTP, {SIG_DFL}, {SIG_IGN}, 8) = 0
    [pid 27764] rt_sigaction(SIGTTIN, {SIG_DFL}, {SIG_IGN}, 8) = 0
    [pid 27764] rt_sigaction(SIGTTOU, {SIG_DFL}, {SIG_IGN}, 8) = 0
    [pid 27764] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    [pid 27764] close(3)                    = 0
    [pid 27764] close(4)                    = 0
    [pid 27764] close(0)                    = 0
    [pid 27764] close(1)                    = 0
    [pid 27764] close(2)                    = 0
    [pid 27764] setgid32(0)                 = 0
    [pid 27764] open("/etc/passwd", O_RDONLY) = 0
    [pid 27764] fcntl64(0, F_GETFD)         = 0
    [pid 27764] fcntl64(0, F_SETFD, FD_CLOEXEC) = 0
    [pid 27764] fstat64(0, {st_mode=S_IFREG|0644, st_size=3196, ...}) = 0
    [pid 27764] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40014000
    [pid 27764] _llseek(0, 0, [0], SEEK_CUR) = 0
    [pid 27764] read(0, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 3196
    [pid 27764] close(0)                    = 0
    [pid 27764] munmap(0x40014000, 4096)    = 0
    [pid 27764] open("/etc/group", O_RDONLY <unfinished ...>
    [pid 27743] time( <unfinished ...>
    [pid 27764] <... open resumed> )        = 0
    [pid 27743] <... time resumed> [1055179822]) = 1055179822
    [pid 27764] fcntl64(0, F_GETFD <unfinished ...>
    [pid 27743] time( <unfinished ...>
    [pid 27764] <... fcntl64 resumed> )     = 0
    [pid 27743] <... time resumed> [1055179822]) = 1055179822
    [pid 27764] fcntl64(0, F_SETFD, FD_CLOEXEC <unfinished ...>
    [pid 27743] getpid( <unfinished ...>
    [pid 27764] <... fcntl64 resumed> )     = 0
    [pid 27743] <... getpid resumed> )      = 27743
    [pid 27764] fstat64(0,  <unfinished ...>
    [pid 27743] rt_sigaction(SIGPIPE, {0x401592c0, [], 0x4000000},
    <unfinished ...>
    [pid 27764] <... fstat64 resumed> {st_mode=S_IFREG|0644, st_size=1057, 
...}) = 0
    [pid 27743] <... rt_sigaction resumed> {SIG_IGN}, 8) = 0
    [pid 27764] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
    [pid 27743] send(7, "<86>Jun  9 12:30:22 xinetd[27743"..., 78, 0
    <unfinished ...>
    [pid 27764] <... mmap2 resumed> )       = 0x40014000
    [pid 27743] <... send resumed> )        = 78
    [pid 27764] _llseek(0, 0,  <unfinished ...>
    [pid 27743] rt_sigaction(SIGPIPE, {SIG_IGN},  <unfinished ...>
    [pid 27764] <... _llseek resumed> [0], SEEK_CUR) = 0
    [pid 27743] <... rt_sigaction resumed> NULL, 8) = 0
    [pid 27764] read(0,  <unfinished ...>
    [pid 27743] select(7, [3 6], NULL, NULL, NULL <unfinished ...>
    [pid 27764] <... read resumed> "root::0:root\nbin::1:root,bin,dae"..., 
4096) = 1057
    [pid 27764] read(0, "", 4096)           = 0
    [pid 27764] close(0)                    = 0
    [pid 27764] munmap(0x40014000, 4096)    = 0
    [pid 27764] setgroups32(0xb, 0x8087340) = 0
    [pid 27764] setuid32(0)                 = 0
    [pid 27764] socket(PF_UNIX, SOCK_STREAM, 0) = 0
    [pid 27764] connect(0, {sin_family=AF_UNIX, path="/var/run/.nscd_socket"}, 
110) = -1 ENOENT (No such file or directory)
    [pid 27764] close(0)                    = 0
    [pid 27764] open("/etc/hosts", O_RDONLY) = 0
    [pid 27764] fcntl64(0, F_GETFD)         = 0
    [pid 27764] fcntl64(0, F_SETFD, FD_CLOEXEC) = 0
    [pid 27764] fstat64(0, {st_mode=S_IFREG|0644, st_size=553, ...}) = 0
    [pid 27764] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40014000
    [pid 27764] read(0, "# /etc/hosts:  This file describ"..., 4096) = 553
    [pid 27764] read(0, "", 4096)           = 0
    [pid 27764] close(0)                    = 0
    [pid 27764] munmap(0x40014000, 4096)    = 0
    [pid 27764] socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 0
    [pid 27764] connect(0, {sin_family=AF_INET, sin_port=htons(53), 
sin_addr=inet_addr("www.xxx.yyy.zzz")}}, 28) = 0
    [pid 27764] send(0, 
"Il\1\0\0\1\0\0\0\0\0\0\003141\00259\003149\003209\7in-"..., 45, 0) = 45
    [pid 27764] gettimeofday({1055179822, 161471}, NULL) = 0
    [pid 27764] poll([{fd=0, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
    [pid 27764] recvfrom(0, 
"Il\201\200\0\1\0\1\0\2\0\0\003141\00259\003149\003209\7"..., 65536, 0, 
{sin_family=AF_INET, sin_port=htons(53), 
sin_addr=inet_addr("www.xxx.yyy.zzz")}}, [16]) = 128
    [pid 27764] close(0)                    = 0
    [pid 27764] time([1055179822])          = 1055179822
    [pid 27764] time([1055179822])          = 1055179822
    [pid 27764] getpid()                    = 27764
    [pid 27764] rt_sigaction(SIGPIPE, {0x401592c0, [], 0x4000000}, {SIG_DFL}, 
8) = 0
    [pid 27764] send(7, "<86>Jun  9 12:30:22 xinetd[27764"..., 75, 0) = 75
    [pid 27764] rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
    [pid 27764] _exit(0)

the last syscall of note is the recvfrom() call to the dns server.  the
hostname in .amandahosts is correct.

no files are generated in /tmp/amanda (in fact, the directory is not
even created, amanda/disk or root/root).  i've been banging my head
against a solid brick wall for weeks regarding this issue.  any ideas
are greatly appreciated.

-mike

------------------------------------------------------------------------
   /~\  the ascii                   "life would be so much easier if we
   \ /  ribbon campaign             could just look at the source code"
    X   against html                                      -- dave olson
   / \  email!

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