Score:0

Reloading /etc/ld.so.preload without starting a new shell

de flag

I'm adding a preload library using /etc/ld.so.preload. My problem is, it doesn't take effect until a new shell is created. This also happens if I remove the preload library. I get error messages for the missing library until I load a new shell.

So, my question is, How can I force a reload of /etc/ld.so.preload? I looked a the man pages and can't find anything describing the mechanism of when or how it is loaded.

Score:1
hk flag

When you add a library to the /etc/ld.so.preload file, it specifies that the dynamic linker should load that library before any other library. This means that when you execute a program, the specified library will be loaded before any other libraries that the program depends on.

However, once the preload library has been loaded, it remains in memory until the process that loaded it terminates. This means that if you remove the library from /etc/ld.so.preload, it will not be removed from memory until the process that loaded it terminates. Similarly, if you add a library to /etc/ld.so.preload, it will not take effect until a new process is created.

To force the dynamic linker to reload the libraries specified in /etc/ld.so.preload, you can use the command:

sudo ldconfig -v -n /etc/ld.so.preload

This command will reload the libraries specified in /etc/ld.so.preload and other configuration files in /etc/ld.so.conf.d/. The -v flag is used to print the output of the command to the console, and the -n flag is used to specify the directory containing the configuration files.

Score:0
in flag

Might be this is not the answer to your question but consider as alternative.

You can try using below.

$ LD_PRELOAD="<colon separated .so path which might be in your ld.so.preload>" <your command>

Example:

LD_PRELOAD="/mypath1/myso1.so:/mypath2/myso2.so" ls -lh
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.