On Sunday 16 May 2010 22:26:13 Phil Stracchino wrote:
> On 05/16/10 16:04, Kern Sibbald wrote:
> > On Sunday 16 May 2010 19:25:04 Phil Stracchino wrote:
> >> Yes, it would definitely be a non-trivial project (and one requiring
> >> much more knowledge of autoconf than I have).  I was quite taken back to
> >> discover how much of the configuration currently does not yield the
> >> expected results, and more so to discover that I could not build a fully
> >> static client on Linux at all.
> >
> > Well, you *can* build a static client.
> >
> > Just use the appropriate options.  They are documented.  I think the key
> > is --disable-libtool if I am not mistaken.
>
> No, there's more to it than that.  That's just the configuration issue:
> you must both use the --enable-static option and *explicitly* add
> disable-libtool.  But there's a more serious problem beyond that.
>
> The major problem is that when building against a current glibc, the
> functions dlopen, initgroups, getgrdir, getgrnam, endgrent, getpwnam,
> getpwuid, endpwent, getaddrinfo, gethostbyname2, and getservbyname still
> require that the glibc dynamic link libraries *that the client was built
> against* be present in order for it to run.  The resulting client is /de
> facto/ partially statically linked and partially dynamically linked.  If
> you build a "static" Linux client, then try to execute it from a rescue
> CD environment that has a different minor version of glibc than the one
> the client was built against, the client will start up correctly and
> run, and will actually respond correctly to a "status client" and
> continue to run, but will SEGV as soon as you try to begin a restore.

To build a static client, you must have static copies of all the libraries you 
want to build with  -- this isn't a Bacula problem.  We have always been able 
to build a static client in all versions of Bacula -- the only exception is 
that I have never found static libraries for openssl.  

After building it, you must always do an "ldd bacula-fd" to be sure it built 
correctly.

It is possible to build a static version of Bacula with openssl using Ermine, 
which is what we use for building the Bacula Systems USB rescue key.  See 
www.bacula.org -> Ermine for more info on that ...

Regards,

Kern

>
> *If you don't see the compile warnings*, there is no indication that you
> haven't built a fully working static client ... until you try to use it
> in a bare-metal-restore situation on a minimal rescue CD.  On the system
> you built it from, with the build glibc available, it will work perfectly.
>
> I have a suspicion this has to do with nsswitch and PAM issues, but it's
> only a theory at this point.



------------------------------------------------------------------------------

_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to