LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2006, 06:50 PM   #1
slinky2004
Member
 
Registered: Oct 2004
Posts: 309

Rep: Reputation: 30
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?
 
Old 01-03-2006, 07:07 PM   #2
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 31
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)

Last edited by vls; 01-03-2006 at 07:15 PM.
 
Old 01-03-2006, 07:56 PM   #3
slinky2004
Member
 
Registered: Oct 2004
Posts: 309

Original Poster
Rep: Reputation: 30
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?
 
Old 01-03-2006, 07:58 PM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
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.
 
Old 01-03-2006, 08:10 PM   #5
detpenguin
Senior Member
 
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,098

Rep: Reputation: 54
how would one go about disabling ldconfig...say on a slack box?
 
Old 01-03-2006, 08:46 PM   #6
mokele
Member
 
Registered: Jan 2005
Location: Puerto Rico
Distribution: Slackware 13
Posts: 146

Rep: Reputation: 15
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

Last edited by mokele; 01-03-2006 at 08:59 PM.
 
Old 01-03-2006, 10:19 PM   #7
detpenguin
Senior Member
 
Registered: Oct 2003
Location: lost in the midwest...
Distribution: Slackware
Posts: 1,098

Rep: Reputation: 54
excellent!!! thanks
 
Old 01-03-2006, 10:40 PM   #8
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
i just moved mine to rc.0
 
Old 01-04-2006, 12:05 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,445
Blog Entries: 4

Rep: Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897
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. 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 ... 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.
 
Old 01-05-2006, 06:52 AM   #10
slinky2004
Member
 
Registered: Oct 2004
Posts: 309

Original Poster
Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ldconfig at startup Riddick Slackware 13 10-15-2005 01:02 PM
What is ldconfig? MicahCarrick Linux - Software 2 10-03-2005 06:31 PM
ldconfig diefree Fedora 4 12-11-2004 02:20 AM
what does ldconfig do ? rajorshi Slackware 8 09-14-2004 04:19 PM
ldconfig gui10 Slackware 3 05-14-2002 08:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration