[nSLUG] Chapter Three - Some HP Installation Progress.

Bill Davidson bdavidso at supercity.ns.ca
Wed May 11 15:22:15 ADT 2005


On Wed, 2005-11-05 at 14:53 -0300, robert wrote:
> On Wed, 2005-11-05 at 12:50 -0300, Bill Davidson wrote: 
> > > Could you specify the directory environment and the options/arguments
> > > for the ldconfig command?
> > 
> > No, that's what "man" is for.

Hmm, maybe that sounded mean, but I didn't intend it that way.  I just
meant that if I attempt to explain all the uses and options of that
command it is highly unlikely that I will be either complete or correct,
whereas the real documentation is at your fingertips.  And in fact,
everything I wrote about ldconfig is wrong!

> Well, the man terminology on is still pretty dense and mystifying. So I
> tried a bunch of things...

Trying a bunch of things is generally useful and satisfying, but is
downright dangerous if you do it as root.  The "man" syntax and
organization can take a little getting used to, but in this case is
pretty clear:


> NAME
>        ldconfig - configure dynamic linker run-time bindings

So that's what it is.


> SYNOPSIS
>        ldconfig [OPTION...]

So that's how we use it.


> DESCRIPTION
>        ldconfig  creates  the  necessary  links  and cache (for use by the run-time linker, ld.so) to the most recent
>        shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf,  and  in
>        the  trusted  directories  (/usr/lib and /lib).  ldconfig checks the header and file names of the libraries it
>        encounters when determining which versions should have their links updated.  ldconfig ignores  symbolic  links
>        when scanning for libraries.

Notice that it updates the links needed by the run-time linker, not those needed by the link-time linker.
That's where I was wrong.

> usr/bin# ldconfig libjpeg.so
> ldconfig: relative path 'libjpeg.so' used to build cache
> 

Let's look again at what the man page says:

creates  the  necessary  links [...] to the most recent shared libraries found 
in the directories specified on the command line, in the file /etc/ld.so.conf, 
and in the  trusted  directories.

So you specified "libjpeg.so" on the command line, so ldconfig took that to be a 
relative path to a directory holding library files.

But this is all moot since I was so completely wrong.

Here is proof:

bdavidso at plato2:~$ ls -l /usr/lib/libjpeg*
-rw-r--r--  1 root root 158168 2003-10-06 11:21 /usr/lib/libjpeg.a
-rw-r--r--  1 root root    802 2003-10-06 11:21 /usr/lib/libjpeg.la
lrwxrwxrwx  1 root root     17 2004-10-22 18:03 /usr/lib/libjpeg.so -> libjpeg.so.62.0.0
lrwxrwxrwx  1 root root     17 2004-10-22 18:01 /usr/lib/libjpeg.so.62 -> libjpeg.so.62.0.0
-rw-r--r--  1 root root 122176 2003-10-06 11:21 /usr/lib/libjpeg.so.62.0.0
bdavidso at plato2:~$ su -c "rm /usr/lib/libjpeg.so"
Password:
bdavidso at plato2:~$ ls -l /usr/lib/libjpeg*
-rw-r--r--  1 root root 158168 2003-10-06 11:21 /usr/lib/libjpeg.a
-rw-r--r--  1 root root    802 2003-10-06 11:21 /usr/lib/libjpeg.la
lrwxrwxrwx  1 root root     17 2004-10-22 18:01 /usr/lib/libjpeg.so.62 -> libjpeg.so.62.0.0
-rw-r--r--  1 root root 122176 2003-10-06 11:21 /usr/lib/libjpeg.so.62.0.0
bdavidso at plato2:~$ su -c ldconfig
Password:
bdavidso at plato2:~$ ls -l /usr/lib/libjpeg*
-rw-r--r--  1 root root 158168 2003-10-06 11:21 /usr/lib/libjpeg.a
-rw-r--r--  1 root root    802 2003-10-06 11:21 /usr/lib/libjpeg.la
lrwxrwxrwx  1 root root     17 2004-10-22 18:01 /usr/lib/libjpeg.so.62 -> libjpeg.so.62.0.0
-rw-r--r--  1 root root 122176 2003-10-06 11:21 /usr/lib/libjpeg.so.62.0.0


-- 
Bill Davidson
bdavidso at supercity.ns.ca


!DSPAM:42824d5b278971508511760!




More information about the nSLUG mailing list