|
From: ahmedaden on 16 Apr 2008 13:46 Hi guys, I have noticed that /sbin/ldconfig runs at each boot and that it adds a bit of time to the bootup process. I checked the man page but I don't really understand what is happening. Does this have to be run at each bootup AND can someone give me a description of what it does? Thanks
From: Dave Uhring on 16 Apr 2008 13:58 On Wed, 16 Apr 2008 10:46:25 -0700, ahmedaden wrote: > I have noticed that /sbin/ldconfig runs at each boot and that it adds a > bit of time to the bootup process. I checked the man page but I don't > really understand what is happening. The man page is well written. What part do you not understand? > Does this have to be run at each bootup AND can someone give me a > description of what it does? You can disable it in /etc/rc.d/rc.M if you wish and find out for yourself what it does.
From: Henrik Carlqvist on 16 Apr 2008 14:11 ahmedaden(a)gmail.com wrote: > I have noticed that /sbin/ldconfig runs at each boot and that it adds a > bit of time to the bootup process. I checked the man page but I don't > really understand what is happening. > > Does this have to be run at each bootup AND can someone give me a > description of what it does? When you run a program your computer reads code from the binary file that is the program itself, e g /bin/ls is read and executed every time you execute the command "ls". However, in most cases not only the single binary executable file is enough but also some other files are needed. Those files also containing executable code are called dynamic libraries. You can see if a program depends on any dynamic libraries by using the ldd program, e g: $ ldd /bin/ls librt.so.1 => /lib/librt.so.1 (0x4002d000) libc.so.6 => /lib/libc.so.6 (0x40040000) libpthread.so.0 => /lib/libpthread.so.0 (0x40176000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) In this case ls depends on four different dynamic libraries. It is also possible to build static executable files that contain all the code needed in a single file but those executable files will then be a lot bigger. With the command "file" you can see if a binary executable is a statically linked or dynamically linked. Some more examples: $ file /bin/ls /bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped $ file /usr/local/bin/wine-preloader /usr/local/bin/wine-preloader: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped $ ldd /usr/local/bin/wine-preloader not a dynamic executable Dynamic libaries are files that contain a version string in the file name, and when executables are linked not all sub versions are specified. To find the right library symbolic links are created from the right files with complete version numbers to files which can be found by executables. Some more examples: $ ldd /bin/ls librt.so.1 => /lib/librt.so.1 (0x4002d000) libc.so.6 => /lib/libc.so.6 (0x40040000) libpthread.so.0 => /lib/libpthread.so.0 (0x40176000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) $ file /lib/libpthread.so.0 /lib/libpthread.so.0: symbolic link to libpthread-0.10.so $ file /lib/libpthread-0.10.so /lib/libpthread-0.10.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped Those symbolic links are created by ldconfig. Each time a new dynamic library is installed ldconfig should be run. In theory, it could be possible that you have booted from a CD or from another partition and installed libraries on your Slackware installation since last reboot. For that reason it is a rather good idea to run ldconfig in the bootup scripts. regards Henrik -- The address in the header is only to prevent spam. My real address is: hc3(at)poolhem.se Examples of addresses which go to spammers: root(a)localhost postmaster(a)localhost
From: Massimiliano Vessi on 16 Apr 2008 17:52 ahmedaden(a)gmail.com il 19:46, mercoled� 16 aprile 2008 ha scritto: > > Hi guys, > > I have noticed that /sbin/ldconfig runs at each boot and that it adds > a bit of time to the bootup process. I checked the man page but I > don't really understand what is happening. > > Does this have to be run at each bootup AND can someone give me a > description of what it does? > ldconfig check new libraries installed and wirte in al list to find easily to other program. If you prefer you can install anacron and perform this check every xx days. Max -- Cerchi informazioni su Linux? Linuxpedia: http://maxint.dynalias.org
From: D Herring on 16 Apr 2008 21:00
ahmedaden(a)gmail.com wrote: > Hi guys, > > I have noticed that /sbin/ldconfig runs at each boot and that it adds > a bit of time to the bootup process. I checked the man page but I > don't really understand what is happening. > > Does this have to be run at each bootup AND can someone give me a > description of what it does? Most programs use shared libraries (dlls in Windows-land). As a performance optimization, ldconfig searches the paths listed in /etc/ld.so.conf and makes a list of what it finds in /etc/ld.so.cache. Thus the linker doesn't have to search the paths each time a program loads. Really, ldconfig only needs to be called after installing a library into one of these paths. However, new users don't know to do that; but they have picked up this bad habit (who knows where) of rebooting whenever something doesn't work. Hence ldconfig (and a couple other caching programs) got added to the startup sequence. Look in /etc/rc.d for the startup scripts. - Daniel |