Prelinking


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.

image from book
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.

  1. Open a Konsole window (K menu ® System ® Terminal ® Konsole) and switch to root user (type su).

  2. Navigate to the /etc/sysconfig/ directory and open the prelink file in a text editor.

  3. Change the line that reads:

    USE_PRELINK="no"

    to

    USE_PRELINK="yes"
  4. 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.

  5. Issue the prelink command itself:

    prelink –a

    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:

prelink /usr/bin/cdrecord

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




Beginning SUSE Linux from Novice to Professional
Beginning SUSE Linux: From Novice to Professional
ISBN: 1590594584
EAN: 2147483647
Year: 2005
Pages: 293
Authors: Keir Thomas

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net