LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   is ldconfig necessary on startup? (https://www.linuxquestions.org/questions/linux-newbie-8/is-ldconfig-necessary-on-startup-399220/)

slinky2004 01-03-2006 06:50 PM

is ldconfig necessary on startup?
 
i'm trying to make my bootup faster, and running ldconfig seems to be the thing that slows it down the most. i've tried editing the init script so that ldconfig is run in the background with the &, but it still slows down the startup because it seems to require a lot of processing and stuff. what i want to know is: would it be a huge problem if i just disabled it? apparently it "creates the necessary links and cache to the most recent shared libraries", but doesnt it keep some kind of more permenant database or list of the shared libraries or does it have to be created on every startup? if that's the case, couldn't i just run it once in a while when i know that my shared libraries have changed?

vls 01-03-2006 07:07 PM

You don't have to run ldconfig on every boot up.
ldconfig only needs to be run when you compile some kind of library and most source code packages will do that on a 'make install'. It doesn't hurt to do it manually just to make sure.

I think that distro's do it just as a safety net.

EDIT: any precompiled package should also run ldconfig if necessary but as I said before it doesn't hurt to run ldconfig after any kind of upgrade. ( or downgrade as the case may be)

slinky2004 01-03-2006 07:56 PM

well i guess i'm getting rid of it then. i dont need to run depmod -a on every startup so why do i run this?

reddazz 01-03-2006 07:58 PM

When I used Slackware, I used to disable it and my boot up time greatly improved. As mentioned above you can then manually run it as root whenever you wish.

detpenguin 01-03-2006 08:10 PM

how would one go about disabling ldconfig...say on a slack box?

mokele 01-03-2006 08:46 PM

In Slackware, you have to edit your /etc/rc.d/rc.M
search for this lines:
Code:

# Update all the shared library links:
if [ -x /sbin/ldconfig ]; then
  echo "Updating shared library links:  /sbin/ldconfig"
  /sbin/ldconfig
fi

Comment them all. If you wish you can add an extra
5 to 6 seconds comenting this too:
Code:

# Update the X font indexes:
if [ -x /usr/X11R6/bin/fc-cache ]; then
  echo "Updating X font indexes:  /usr/X11R6/bin/fc-cache"
  /usr/X11R6/bin/fc-cache
fi

That will disable ldconfig as well as fc-cache

Then add this lines to your /etc/rc.d/rc.local
Code:

/usr/bin/echo "ldconfig" | /usr/bin/at now +5minutes
/usr/bin/echo "/usr/X11R6/bin/fc-cache" | /usr/bin/at now +6minutes

This will make your ldconfig run 5 minutes after booting
scripts finish and fc-cache 6 minutes after.

You can find more info about this porcedures here and here

-W

detpenguin 01-03-2006 10:19 PM

excellent!!! thanks :)

Boow 01-03-2006 10:40 PM

i just moved mine to rc.0

sundialsvcs 01-04-2006 12:05 PM

Obviously what the distro people were doing was trying to make sure that these tasks were always done, even by Windows-oriented folks who "automatically reboot" when something peculiar happens.

The purpose of ldconfig is to update the "shared library cache," which enables Linux to find shared libraries (think, "DLLs") quickly and accurately. ex minimis, this command must be run whenever a shared library is changed, but that actually doesn't happen often and most Makefiles will do that step for you when they do.

The purpose of depmod is to update the kernel-module dependency map. :confused: This tells commands like modprobe which kernel-modules (loadable parts of the kernel...) depend upon which others, so that if you ask to load a particular module, all of the modules that it needs will be loaded as well. Once again this is something that must be done if you change a kernel module, but once again, how often do you actually do that? Answer: not very often.

You do need to be mindful ... :tisk: very mindful ... of the fact that you are now changing something that the distro-writer put into place and subsequently may now rely upon being done. I cannot say whether ordinary installation and/or updating of "packages" on your system may expect, and require, that these operations which you have now omitted will be done upon the next reboot. One would hope that they covered their bases in these two areas by other means than these, but if for whatever reason they did not you may need to (and thus, will need to know how to) run these commands yourself at appropriate times.

slinky2004 01-05-2006 06:52 AM

all the startup script did was "/sbin/ldconfig", no options or parameters or anything, so i think i'll be ok running it by myself when i need to.


All times are GMT -5. The time now is 11:01 PM.