Unfortunate dynamic linking for everything

Andrew Gallatin gallatin at cs.duke.edu
Mon Nov 24 08:30:35 PST 2003

Robert Watson writes:
 > It strikes me that this whole conversation has gotten a little
 > confrontational...  The "middle ground" of adding a static /sbin/sh for
 > scripts soudds like a reasonable choice, and has precedent in other
 > systems (Solaris).  We can set the boot and periodic scripts to use that,
 > and interactive users can keep using /bin/sh.  Someone must be using
 > /bin/sh as a shell, because apparently someone spent a lot of time adding
 > things like character input editing, filename completion, etc.  We even
 > use "sh" as the default in adduser(8).

Tru64 also does the /sbin/sh (static) and /bin/sh (dynamic) thing.
I've never liked it because standard, portable shell scipts expect to
use /bin/sh.  Standard, portable shell scripts don't need tilde
expansion for ldap/nss usernames.

So I think the best solution (*) would be to keep /bin/sh statically
linked, and build a dynamic version in /usr/bin that people can use as
an interactive shell.  Root's shell remains /bin/sh

1) All three (;-) interactive bourne shell users that use nss/ldap get 
   tilde expansion.

2) 3rd party scripts, which are written to be portable and don't use
   tilde, don't have to pay for dynamic linking.

3) System startup scripts are faster because they use the static

(*) The real best solution would be to backout the dynamic linking
changes and put the onus on those who want/need nss/ldap to prove that
the dynamic linking changes do not produce a measurable slowdown (as
they were asked to do 6 months ago, and never did).  If it really
slows things down, then they need to fix the performance problems by
either speeding up dynamic linking,  or getting the features they need
in another, less invasive way (as discussed previously in this


[reply-to set to freebsd-current, as I don't want to be CC'ed on this
thread forever.. ]

More information about the freebsd-current mailing list