Subject: Re: /etc/services duplicates - suggestion for fixes
To: None <netbsd-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: netbsd-users
Date: 06/23/2007 15:15:37
In article <20070623061401.GB1247@moray.salmi.ch>,
Jukka Salmi <j+nbsd@2007.salmi.ch> wrote:
>Christos Zoulas --> netbsd-users (2007-06-23 01:10:09 +0000):
>> It does make a lot of sense, but this is not what we do with the other
>> databases currently. And this will cost 2 more stats...
>
>Speaking of some more stats: why is services.db stat()ed and open()ed
>several times when doing something like:
>
>$ ktrace telnet mail.netbsd.org. smtp
>Trying 2001:4f8:4:7:2e0:81ff:fe52:9ab6...
>Trying 204.152.190.11...
>Connected to mail.netbsd.org.
>Escape character is '^]'.
>220 mail.netbsd.org ESMTP Postfix
>quit
>221 Bye
>Connection closed by foreign host.
>$ kdump | grep -B1 services
> 6137 1 telnet CALL __stat30(0xbb9e6d63,0xbfbfe360)
> 6137 1 telnet NAMI "/var/db/services.db"
>--
> 6137 1 telnet CALL open(0xbb9e6d63,0,0)
> 6137 1 telnet NAMI "/var/db/services.db"
>--
> 6137 1 telnet CALL __stat30(0xbb9e6d63,0xbfbfe360)
> 6137 1 telnet NAMI "/var/db/services.db"
>--
> 6137 1 telnet CALL open(0xbb9e6d63,0,0)
> 6137 1 telnet NAMI "/var/db/services.db"
>[...]
> 6137 1 telnet CALL __stat30(0xbb9e6d63,0xbfbfe360)
> 6137 1 telnet NAMI "/var/db/services.db"
>--
> 6137 1 telnet CALL open(0xbb9e6d63,0,0)
> 6137 1 telnet NAMI "/var/db/services.db"
>--
> 6137 1 telnet CALL __stat30(0xbb9e6d63,0xbfbfe360)
> 6137 1 telnet NAMI "/var/db/services.db"
>--
> 6137 1 telnet CALL open(0xbb9e6d63,0,0)
> 6137 1 telnet NAMI "/var/db/services.db"
>
>Hmm, twelve stat()s and twelve open()s, always just to look up `smtp
>25/tcp mail'... Shouldn't this be done only once?
>
>
>Regards, Jukka
Maybe the other ones have to do with other lookups (resolv)?
There is no "stayopen" function for services...
christos