Re: [exim] build exim static

Pàgina inicial
Delete this message
Reply to this message
Autor: Michael Haardt
Data:  
A: exim-users
Assumpte: Re: [exim] build exim static
On Tue, Nov 29, 2005 at 07:04:32PM +0100, Patrice wrote:
> I didn't want to make a chroot for my exim, I just wanted to make a
> directory containing all the binaries and libraries
> needed to run the mail server. (independent from the computer on which
> it is running)


On Unix systems offering the name space switch (NSS), there is nothing
like a truely static executable any more. If you trace a small program
which uses gethostbyname, you will see how NSS loads its modules.
Those modules are loaded using dlopen(). They are not shared libraries
as used by the usual dynamic linker, which is why ldd does not show
the dependency.

A fully dynamic executable always uses the same version of libc and
NSS modules. A "static" executable may load NSS modules that are newer
than its statically linked libc functions - and crash.

I understand your wish, in particular on Linux, where each glibc upgrade
so far managed to break at least a few existing programs for me. But I
don't see how to avoid chroot.

Btw, if Exim used gethostbyname("invalid.") in parent processes before
creating children, NSS modules will be loaded and inherited to children.
I didn't notice a performance improvement, though, and you must use a name
that enforces all modules to be loaded. /etc/nsswitch.conf tells which
argument does that.

Michael