
Prelink for Performance #85
Chapter 9, Administration and Automation
|
257
HACK
Run prelink
To use prelink, you need to ensure that you are running a compiler and
libraries that support this feature. You should aim for a
gcc newer than Ver-
sion 3.1 and a
glibc newer than 2.3. You also need to obtain the prelink tool
from ftp://people.redhat.com/jakub/prelink/. The
prelink tool is also available
in the Debian archive, and RPMs are available at http://www.rpmfind.net/
linux/rpm2html/search.php?query=prelink.
Once you have installed
prelink, you need to run the tool on the binaries and
libraries that are present on your system. To do this, you need to add a list
of the directories containing binaries to /etc/prelink.conf. Here is an example
listing of directories to add:
-l /usr/local/sbin
-l /sbin
-l /usr/sbin
-l /usr/local/bin
-l /bin
-l /usr/bin
-l /usr/X11R6/bin
-l /usr/games
-l /usr/local/lib
-l /lib
-l /usr/lib
-l /usr/X11R6/lib
The -l option included at the beginning of each line ensures that prelink
descends recursively into directories and works on dependent binaries and
libraries. This works under the condition that the directory does not span
across different filesystems or mount points.
To actually perform the prelinking, you need to run the following command
as root whenever you add new software to the system:
foo@bar:~# prelink -afmR
This command prelinks all (-a) binaries and libraries in the paths ...