As we discussed in Chapter 29, a lot of SUSE Linux software relies on other pieces of code to work. These are sometimes referred to as libraries, which is a good indicator as to their purpose: to provide functions that programs can check in and out whenever they need them, as if they were borrowing books from a library.
Whenever a program starts, it must look for these other libraries and load them into memory so they're ready for use. This can take some time, particularly on larger and more complicated programs. Because of this, the concept of prelinking was invented. By a series of complicated tricks, the prelink program makes each bit of software you might run aware of the libraries it needs, so that memory can be better allocated.
Prelinking claims to boost program startup times by up to 50% or more, but the problem is that it's a hack—a programming trick designed to make your system work in a nonstandard way. Because of this, some programs are incompatible with prelinking. In fact, some might simply refuse to work unless prelinking is deactivated. At the time of writing, such programs are in the minority. However, keep in mind that prelinking can be easily reversed if necessary. Alternatively, you might want to weigh whether it's actually worth setting up prelinking in the first place.
If you decide to go ahead, you'll need to install the relevant software from the SUSE Linux installation DVD, so insert that in your computer drive first. Select K menu ® Control Center, click YaST2 Modules, click the Software icon, and then click Install and Remove Software. In the Search box, type prelink, as shown in Figure 31-4. In the list of results on the right, put a tick into the Prelinking box. Then click Accept to install the software.
Figure 31-4. The prelink program is able to shorten the time taken to start your applications.
Once the software is installed, activating the prelinking function is easy.
Open a Konsole window (K menu ® System ® Terminal ® Konsole) and switch to root user (type su).
Navigate to the /etc/sysconfig/ directory and open the prelink file in a text editor.
Change the line that reads:
Run the SuSEconfig program (open a Konsole window and type SuSEconfig) to ensure system configuration files are up-to-date, including those that have been added relating to prelinking.
Issue the prelink command itself:
The -a command option is used with prelink to ensure all binary files are prelinked (according to the /etc/prelink.conf file, that is, which includes lists of notable exceptions). Prelinking can take some time to work through your system, and you might see some error messages. It's normally safe to ignore these.
Prelinking can also work on individual files if you specify a path:
This example will prelink just the cdrecord program.
Using the command on individual files can prove useful if you run into trouble after performing a prelinking sweep of your system, because you can use the -u command option to undo any prelinking:
prelink –u /usr/bin/cdrecord