Choosing Software Alternatives

Choosing Software Alternatives

Because several software packages are available for every major service available in Linux (such as mail, printing, and so on), there will be times when people using the system will prefer one service over another. Software packages that have been designed to work with the alternatives system can be configured in Red Hat Linux to let an administrator choose which of the alternatives to a particular service he or she wants to use by default.

Selecting mail and printing alternatives

Beginning with Red Hat Linux 7.3, which was the first version to offer the alternatives feature, two major services were configured to use alternatives: mail transport and printing services. The alternatives facility lets users choose the following, related to mail transport and printing:

  • Mail Transport Agent (MTA) — If both the sendmail and postfix mail transport agents are installed, as an administrator you can choose which of those two services is the default for sending e-mail.

  • Printing — If both LPRng and CUPS printing services are installed, you can choose which service is the default for printing documents.

As an administrator, you still need to configure each alternative service to work. Descriptions for configuring sendmail and postfix mail-transport agents are contained in Chapter 19. Information on setting up the CUPS printing service is in Chapter 17. (LPRng is no longer delivered with Red Hat Linux, although it is still available from sites such as

In terms of setting up the alternatives side of mail and printing services, much of the work of creating links so that the services can be chosen has already been done. Links relating to the default services are set up in the /etc/alternatives directory. Definitions that identify the alternative components of mail and printing are contained in the /var/lib/alternatives directory.

Because much of the configuration has been done in advance, the first step in switching between the different printing or mail services installed on your computer is only a couple of clicks away. To switch the default mail or printing services on your computer, do the following:

  1. Select one of the following from the Red Hat menu, depending on whether you want to switch your mail or printing service:

    • To switch print service, select System Settings ? More System Settings ? Printer System Switcher.

    • To switch mail service, select System Tools ? More System Tools ? Mail Transport Agent Switcher.

    The switcher window for the service you requested appears.

  2. Click on the service you want to switch to — LPRng or CUPS for printing, Sendmail or Postfix for mail. (If the one you want is already selected, you can just cancel.)

    If the switch is successful, a pop-up window tells you to restart the new service.

  3. Close the pop-up window.

The next time your computer boots, your new printing or mail service takes over that service. All the links are in place and the start-up scripts are changed. However, your system is still running the old service. The start-up scripts for those four services are in the /etc/init.d directory. They are as follows:

  • lpd

For the LPRng printing service

  • cups

For the CUPS printing service

  • sendmail

For the Sendmail service

  • postfix

For the Postfix service

To stop the old service so that the new one can take over, type the following (replacing service with the name of the service you want to stop):

# /etc/init.d/service stop

To start the new service, type the following (replacing service with the name of the service you want to start):

# /etc/init.d/service start

Providing that the new service was configured properly, it should now be available to the users of your computer.

Using mail and printing alternatives

The printing and mail-transport services that the alternatives facility allows you to change rely on many of the same command names. For example, both printing services use the lpr command to print and the lpq command to see a printer queue. Both Postfix and Sendmail have a newalias command and mailq commands for updating aliases and checking the mail queue, respectively.

So, to the user, a change in mail or printing services should (in theory) be nearly invisible. Users can print documents using the same commands they always used and the documents will be printed. Users can send mail as they always did and the fact that a different mail transport is being used should make no difference.

Part IV: Red Hat Linux Network and Server Setup