[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: slapd's sockets in CLOSE_WAIT




On Fri, 21 Jan 2000, Kurt D. Zeilenga wrote:

> At 11:15 AM 1/21/00 +0100, Giuseppe Lobiondo wrote:
> >I noticed that each user process opens a socket to the server and the
> >LDAP server has a lot of open sockets in CLOSE_WAIT state.
> 
> The server is awaiting the TCP fin from the client...
> What's the state of the other side of the TCP stream?

.. 

for an "normal" connection I have:


zsh      14412 lobiondo    3u  inet 2447675       TCP host.mi.infn.it:4126->host.mi.infn.it:ldap (ESTABLISHED)
newmail  14436 lobiondo    3u  inet 2447675       TCP host.mi.infn.it:4126->host.mi.infn.it:ldap (ESTABLISHED)
slapd    29584     root   32u  inet 2447676       TCP host.mi.infn.it:ldap->host.mi.infn.it:4126 (ESTABLISHED)
slapd    29586     root   32u  inet 2447676       TCP host.mi.infn.it:ldap->host.mi.infn.it:4126 (ESTABLISHED)
slapd    29587     root   32u  inet 2447676       TCP host.mi.infn.it:ldap->host.mi.infn.it:4126 (ESTABLISHED)

Connected on both sides.

For the connections in CLOSE_WAIT:


zsh      26305 abaldini    3u  inet 2131575       TCP host.mi.infn.it:2356->host.mi.infn.it:ldap (CLOSE_WAIT)
newmail  26330 abaldini    3u  inet 2131575       TCP host.mi.infn.it:2356->host.mi.infn.it:ldap (CLOSE_WAIT)
xbiff    26335 abaldini    3u  inet 2131575       TCP host.mi.infn.it:2356->host.mi.infn.it:ldap (CLOSE_WAIT)


and no corrispondent on slapd's port.

the zsh process is  awaiting for terminal input at this point. I don't
know why a fin was not sent to the server socket, can it depend on
nss_ldap?

----zsh 

#strace -p  26305 
about to attach 66c1
read(10, ...

# lsof -p  26305   
COMMAND   PID     USER   FD   TYPE  DEVICE    SIZE   NODE NAME
zsh     26305 abaldini  cwd    DIR    8,48    1024 159745 /users/abaldini
zsh     26305 abaldini  rtd    DIR    8,10    1024      2 /
zsh     26305 abaldini  txt    REG    8,10  340548  20175 /bin/zsh
zsh     26305 abaldini  mem    REG    8,10  342206  24098 /lib/ld-2.1.1.so
zsh     26305 abaldini  mem    REG     8,6      44 331778 /usr/share/locale/en_US/LC_MESSAGES/SYS_LC_MESSAGES
zsh     26305 abaldini  mem    REG     8,6      93 329732 /usr/share/locale/en_US/LC_MONETARY
zsh     26305 abaldini  mem    REG    8,10   15129  24157 /lib/libtermcap.so.2.0.8
zsh     26305 abaldini  mem    REG    8,10  364235  24118 /lib/libnsl-2.1.1.so
zsh     26305 abaldini  mem    REG    8,10 4016683  24105 /lib/libc-2.1.1.so
zsh     26305 abaldini  mem    REG    8,10  243964  24136 /lib/libnss_files-2.1.1.so
zsh     26305 abaldini  mem    REG    8,10  342458  24190 /lib/libnss_ldap-2.1.1.so
zsh     26305 abaldini  mem    REG    8,10  235419  24144 /lib/libpthread-0.8.so
zsh     26305 abaldini  mem    REG    8,10  164797  24146 /lib/libresolv-2.1.1.so
zsh     26305 abaldini  mem    REG     8,6   29970 329730 /usr/share/locale/en_US/LC_COLLATE
zsh     26305 abaldini  mem    REG     8,6     508 329734 /usr/share/locale/en_US/LC_TIME
zsh     26305 abaldini  mem    REG     8,6      27 329733 /usr/share/locale/en_US/LC_NUMERIC
zsh     26305 abaldini  mem    REG     8,6   10428 329731 /usr/share/locale/en_US/LC_CTYPE
zsh     26305 abaldini    0u   CHR   136,2              4 /dev/pts/2
zsh     26305 abaldini    1u   CHR   136,2              4 /dev/pts/2
zsh     26305 abaldini    2u   CHR   136,2              4 /dev/pts/2
zsh     26305 abaldini    3u  inet 2131575            TCP host.mi.infn.it:2356->host.mi.infn.it:ldap (CLOSE_WAIT)
zsh     26305 abaldini   10u   CHR   136,2              4 /dev/pts/2


 
> >I'm not sure but I think this is for the clients to reuse the same socket
> >later instead of creating a new one. (in slapd's daemon.c I've found
> >that the server sets the flag SO_REUSEADDR on sockets)
> 
> Yes, but it doesn't relate to your problem.  See setsockopt(3).
> 
> >But since the open sockets are local it is possible for local processes
> >use Unix Domain sockets? (if yes how?)
> 
> Not in OpenLDAP 1.x.
> 

Are you going to introduce this on v 2.X?

Thanks a lot, Giuseppe Lo Biondo