# Ack .. did I blow away my ldconfig ?



## absduser (May 22, 2020)

I was checking lib dependencies on a binary and instead of typing:

ldd binary

I accidently typed:

ldconfig binary

... which resulted in all kinds of garbage on the screen and pages of error output ...

I am running 12.1-RELEASE and when I run 'ldconfig -r' I see:

# ldconfig -r
/var/run/ld-elf.so.hints:
 search directories: .

... does that look right ?  Or did I muck everything up ?  I don't have another system to compare it to right now ... 

Thanks.


----------



## richardtoohey2 (May 22, 2020)

I get (on 12.1-RELEASEp5, amd64):

```
%  ldconfig -r
/var/run/ld-elf.so.hints:
    search directories: /lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/mysql:/usr/local/lib/mysql/plugin:/usr/local/lib/perl5/5.30/mach/CORE
    0:-lkvm.7 => /lib/libkvm.so.7
    1:-lumem.2 => /lib/libumem.so.2
    2:-lulog.0 => /lib/libulog.so.0
    3:-lipsec.4 => /lib/libipsec.so.4
    4:-lavl.2 => /lib/libavl.so.2
...
    241:-lunwind.8 => /usr/local/lib/libunwind.so.8
    242:-ltcmalloc_and_profiler.4 => /usr/local/lib/libtcmalloc_and_profiler.so.4
    243:-ltcmalloc_minimal.4 => /usr/local/lib/libtcmalloc_minimal.so.4
    244:-ltcmalloc_debug.4 => /usr/local/lib/libtcmalloc_debug.so.4
    245:-lmysqlclient.20 => /usr/local/lib/mysql/libmysqlclient.so.20
    246:-lmysqlclient_r.20 => /usr/local/lib/mysql/libmysqlclient_r.so.20
```


----------



## absduser (May 22, 2020)

ugh ... how can I reconstruct the default hints that I should have ?

Which is to say, I know how I can add a bunch of hints to the system that I brainstorm, but I would like to just restore the default hints that I should have prior to blowing this away ...


----------



## richardtoohey2 (May 22, 2020)

I don't know how you would fix it.  But might be something in here: https://forums.freebsd.org/threads/ldconfig-default-paths-change.49911/


----------



## acheron (May 22, 2020)

`service ldconfig restart`


----------



## absduser (May 24, 2020)

acheron said:


> service ldconfig restart



That appeared to work - thank you.

Although, I am confused - generally when I start, or restart, a service, there is then a process running on the system that I can see with 'ps' ... but after running:

service ldconfig restart

... I then 'ps auxw|grep ld'  ... and there is nothing ...

What processes are running to support the ldconfig service ?

Thanks.


----------



## acheron (May 24, 2020)

absduser said:


> What processes are running to support the ldconfig service ?
> 
> Thanks.


None, it just runs `ldconfig` with the correct args, see /etc/rc.d/ldconfig


----------

