Making a dynamically-linked root
Sebastian Lederer
sl at linast.de
Wed Jun 4 01:38:18 PDT 2003
On Tue, Jun 03, 2003 at 09:45:53AM -0700, Tim Kientzle wrote:
[...]
> My reasoning is correct. The point here is that /bin/sh is not
> minimalist, as evidenced by the fact that it calls getpwnam(). (Yes,
> this implies that 'ps', 'ls', 'date', and even 'cat' are not "minimalist,"
> either, since they require pluggable library features.) If you want to
> remove features from /bin/sh to make it truly minimal, or add a new static
> shell to the base system, that's a different issue.
>
> The current /bin/sh must be dynamically linked because it relies on NSS.
One could implement an NSS proxy/cache daemon like lookupd in Mac OS X
(or nscd in Linux/Solaris, although the general impression seems to be
that "nscd sucks"). This way static binaries could use dynamic NSS
plugins.
The cache daemon can be dynamically linked and make full use of all
NSS plugins.
A small NSS module that can talk to the daemon can be included into
all statically linked programs.
So when the daemon is not running, programs just use the default
static NSS modules (files, NIS, dns, hesiod). When the daemon IS
running, all programs, statically or dynamically linked, can utilize
all NSS modules which can be loaded dynamically by the daemon.
I think this will also improve performance in certain cases, mostly
when using LDAP, because not every invocation of "ls" will need to
make a new connection to the LDAP server to resolve the uids/gids.
- Sebastian Lederer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20030604/31c95ed6/attachment.bin
More information about the freebsd-arch
mailing list