[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh hangs for 5 seconds for a particular machine



On 2015-04-08 14:27:38 -0600, Bob Proulx wrote:
> Vincent Lefevre wrote:
> > Yes, but with nslookup, the failure is *immediate*. So, this doesn't
> > explain the 5-second delay.
> 
> What is the configuration of /etc/resolv.conf?  /etc/nsswitch.conf?
> 
>   cat /etc/resolv.conf

domain lip.ens-lyon.fr.
search lip.ens-lyon.fr. ens-lyon.fr.
nameserver 140.77.1.32
nameserver 140.77.167.2

which is consistent with the nslookup output.

>   grep "^hosts" /etc/nsswitch.conf

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

> The config there may affect things.  Much less likely would be the
> configuration of /etc/gai.conf file.  Most will have nothing but
> comments there.

Yes, /etc/gai.conf only has comments on this machine.

If I run sshd under strace, I get after the immediate failures on
140.77.1.32 and 140.77.167.2:

[...]
23:54:03 mprotect(0x7f5b92ff3000, 4096, PROT_READ) = 0
23:54:03 munmap(0x7f5b96917000, 176499) = 0
23:54:03 socket(PF_LOCAL, SOCK_STREAM, 0) = 4
23:54:03 fcntl(4, F_GETFD)              = 0
23:54:03 fcntl(4, F_SETFD, FD_CLOEXEC)  = 0
23:54:03 connect(4, {sa_family=AF_LOCAL, sun_path="/var/run/avahi-daemon/socket"}, 110) = 0
23:54:03 fcntl(4, F_GETFL)              = 0x2 (flags O_RDWR)
23:54:03 fstat(4, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
23:54:03 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5b96aa9000
23:54:03 lseek(4, 0, SEEK_CUR)          = -1 ESPIPE (Illegal seek)
23:54:03 write(4, "RESOLVE-ADDRESS 140.77.51.8\n", 28) = 28
23:54:03 read(4, "-15 Timeout reached\n", 4096) = 20
23:54:08 close(4)                       = 0
[...]

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: