Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2008 02:41:03 -0800
From:      Jeremy Chadwick <koitsu@freebsd.org>
To:        perryh@pluto.rain.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: root /etc/csh
Message-ID:  <20081116104103.GA98266@icarus.home.lan>
In-Reply-To: <491fd833.zbV%2Bim4fHqUJ5RRJ%perryh@pluto.rain.com>
References:  <20081110203643.GH27646@obspm.fr> <200811102235.46971.fbsd.questions@rachie.is-a-geek.net> <Pine.GSO.4.63.0811102239200.846@hmacs.cmi.ua.ac.be> <4ad871310811101530p7b2baa0fk7f7b5118e314c11d@mail.gmail.com> <4918CE42.3050504@ccstores.com> <20081115061957.GA10998@ourbrains.org> <20081116023239.GA89267@icarus.home.lan> <20081116033624.GA13618@ourbrains.org> <20081116050107.GA91940@icarus.home.lan> <491fd833.zbV%2Bim4fHqUJ5RRJ%perryh@pluto.rain.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 16, 2008 at 12:22:11AM -0800, perryh@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 |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081116104103.GA98266>