LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Loading libraries during server reboot (https://www.linuxquestions.org/questions/linux-server-73/loading-libraries-during-server-reboot-4175535976/)

guna_pmk 03-06-2015 01:40 PM

Loading libraries during server reboot
 
Hi,

I am configuring a server with some libraries (along with other stuffs). For the libraries to be loaded automatically on a reboot, I create a config file and put it in

Code:

/etc/ld.so.conf.d/mylibs.conf
which contains the location of my libraries (for example /usr/local/lib64).

My servers are Redhat 6.5 64 bit. I expect the libraries in the /usr/local/lib64 to be loaded automatically on a reboot. This seems to work on some servers but not on others. On those server that it did not work, if I issue ldconfig manually after the server reboot (as root), they get loaded.

Why is it not loading on some servers? Which service or setting, loads libraries from directories specified in all the conf files in the /etc/ld.so.conf.d?

Please let me know if you need any more information from my servers?

Thanks

John VV 03-07-2015 12:43 AM

just drop a bash script calling them and or setting variables in /etc/profile.d

that is what this folder is for

unSpawn 03-07-2015 03:50 AM

Quote:

Originally Posted by John VV (Post 5328189)
just drop a bash script calling them and or setting variables in /etc/profile.d
that is what this folder is for

The "that is what it's for" argument can be used in a lot of situations. Does not mean it's the right way. /etc/profile.d/ contents get parsed each time a shell sources /etc/profile (regardless of it being an interactive non-login or non-interactive shell) so that's not an efficient option unless the OP juggles with /usr/local/lib64 contents on say an hourly basis.


Quote:

Originally Posted by guna_pmk (Post 5327968)
My servers are Redhat 6.5 64 bit.

Note 6.6 is current.


Quote:

Originally Posted by guna_pmk (Post 5327968)
I expect the libraries in the /usr/local/lib64 to be loaded automatically on a reboot.

That means you must issue the 'ldconfig' command as root on reboot.


Quote:

Originally Posted by guna_pmk (Post 5327968)
Why is it not loading on some servers?

If you don't then it doesn't update the cache.


Quote:

Originally Posted by guna_pmk (Post 5327968)
Which service or setting, loads libraries from directories specified in all the conf files in the /etc/ld.so.conf.d?

It's not a service unless you make it one ;-p
Sane options are calling 'ldconfig' from a "@reboot" in /etc/crontab or from /etc/rc.d/rc.local. Using the latter ensures all automount points and services are available first, so if you meant to have these libraries loaded for use by services on startup you best check and reload the cache on shutdown or reload instantly using an inotify-based service like 'incron'.

guna_pmk 03-15-2015 05:18 AM

Hi John,

I am with unspawn - profile.d is not the right place for this in my view. I have already implemented the rc.local solution. I just wanted to confirm whether there is any better method for this. Thanks both of you for your time.

Thanks


All times are GMT -5. The time now is 08:34 PM.