root /etc/csh

Jeremy Chadwick koitsu at freebsd.org
Sun Nov 16 02:41:05 PST 2008


On Sun, Nov 16, 2008 at 12:22:11AM -0800, perryh at pluto.rain.com wrote:
> > 3) You can build bash statically; make WITH_STATIC_BASH=true.  I do
> > not know the true reason why the port is not built statically by
> > default, but I can give you a damn good reason why it shouldn't be:
> > complete and total wasted memory.
> >
> > Take into consideration environments where there are hundreds (or at
> > my place of work, thousands) of users logged into a machine at once.
> > Many of those are going to have /usr/local/bin/bash as their shell.
> > A statically-linked version of bash would waste significant amounts
> > of memory, while a dynamically-linked/shared version would ease that
> > pain.  The same applies for any static vs. dynamic program.
> 
> How so?  Wouldn't a single in-memory instance of the bash text
> segment be shared among all bash processes, across all users?

http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/thread.html#36647

> A better reason is that security updates to shared libs often
> update only the .so files, expecting the binaries that use them
> to automatically pick up the new versions.  Any static executable
> should be rebuilt any time there is a security update to a shared
> lib that it would be using were it linked dynamically.

Yup, that's another reason.

> That said, perhaps it would be reasonable for shell ports to
> build both a dynamically-linked instance to be installed in
> /usr/local/bin, and a statically-linked instance to be installed
> in, say, /usr/local/static.  Those who want to use bash as the
> root shell could copy it from there to /bin or /sbin.

This part of the thread should be moved to freebsd-ports, or obrien@
pulled in here.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |



More information about the freebsd-questions mailing list