Follow-up on usrmove and ldconfig

Tom H tomh0665 at gmail.com
Thu Feb 2 15:30:01 UTC 2012


On Wed, Feb 1, 2012 at 8:36 PM, Adam Williamson <awilliam at redhat.com> wrote:
> On Wed, 2012-02-01 at 20:26 -0500, Tom H wrote:
>> [root at localhost ~]# mv /etc/ld.so.conf.d/usrmove.conf .
>> [root at localhost ~]# ldconfig
>> [root at localhost ~]# ldconfig -p | wc -l
>> 825
>> [root at localhost ~]# ldconfig -p | grep usr | wc -l
>> 11
>> [root at localhost ~]# mv usrmove.conf /etc/ld.so.conf.d/
>> [root at localhost ~]# ldconfig
>> [root at localhost ~]# ldconfig -p | wc -l
>> 825
>> [root at localhost ~]# ldconfig -p | grep usr | wc -l
>> 824
>> [root at localhost ~]# ldconfig -p | grep -v usr
>> 824 libs found in cache `/etc/ld.so.cache'
>> [root at localhost ~]#
>>
>> Even though ldconfig links to "/usr/lib" by default, adding "/usr/lib"
>> to its conf seems to create direct links to "/usr/lib" rather than via
>> the "/lib" symlink.
>
> Ah, it may be to do with the ordering, then - somehow adding it as an
> ld.so.conf.d file gives /usr/lib priority over /lib?

You must be right; mentioning one of the two default directories
pushes it up the "priority" list and mentioning both gives a different
result.

[root at localhost ~]# cd /etc/ld.so.conf.d/
[root at localhost ld.so.conf.d]# vi usrmove.conf
[root at localhost ld.so.conf.d]# cat usrmove.conf
/usr/lib
/lib
[root at localhost ld.so.conf.d]# ldconfig
[root at localhost ld.so.conf.d]# ldconfig -p | grep usr | wc -l
824
[root at localhost ld.so.conf.d]# vi usrmove.conf
[root at localhost ld.so.conf.d]# cat usrmove.conf
/lib
/usr/lib
[root at localhost ld.so.conf.d]# ldconfig
[root at localhost ld.so.conf.d]# ldconfig -p | grep usr | wc -l
11
[root at localhost ld.so.conf.d]#


More information about the test mailing list