Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [430]

By Root 3093 0
arguments and call other programs to do the real work of formatting.

Essentially, the interface script is responsible for the entire output stage of the printing system. Although the use of interface scripts makes customization easy, it also leads to different printers behaving in very different ways.

Interfaces are almost essential if you are planning on printing to anything other than a generic text or PostScript printer. Today, almost all printers use them. Inkjet printers absolutely require an interface to translate the print job to their format of choice.

An interface program should exit with a 0 on successful completion and with an integer in the range 1 to 127 if an error is encountered. If a job fails, the interface script should attempt to reprint it. If a serious error occurs, the interface program should disable (see page 726) the printer. If you are having erratic printing problems, you can probably find the cause somewhere in the interface script.

What to do when the lp system is completely hosed


Sometimes, attempts to configure and unconfigure printers leave the lp system hopelessly confused. The config files that hold printer information are complicated and neurotic. One stray character can completely whack out an entire printer.

If you somehow create a printer that is confusing the system, the best solution is to remove the destination completely and start over. Sometimes, the system can be so confused that even removing the printer is hard.

The following brute-force technique will often rescue you from this sort of situation. Here, we try to remove the printer hoser. Don’t use this exact sequence unless your equivalent of hoser is a single printer (not a class).

# lpshut

# lpadmin -xhoser

# find /usr/spool/lp -name hoser -exec rm -rf {} \;

# lpsched

# lpstat -t

The first two commands turn off the spooler and attempt to remove the printer according to the USDA-approved method. If the system is confused, lpadmin -x may fail. The find command removes all interface programs and spool directories for the printer. lpsched restarts the spooler, and lpstat should show you that there are no more references to hoser within the printing system.

23.5 ADDING A PRINTER


In this section we discuss vendor-specific printer configuration details. For each operating system, we investigate:

• Setting up a local serial or parallel printer

• Printing to a network lpd print server

• Accepting lpd print jobs from the network

You’ll note that we only discuss network printing from a BSD-ish perspective. That’s because there is no such thing as System V remote printing; SysV-based systems that want to enable remote printing have adopted parts of the BSD protocol.

In the discussions that follow, we assume that the printer hardware has already been physically connected to a host or the network. See Chapter 7, Serial Devices, for information about connecting serial printers, and Chapter 15, Network Hardware, for general information about connecting devices to a network.

Network printers require a bit of extra configuration. In particular, they have to be assigned an IP address. That’s usually accomplished by one of two methods.

See page 287 for more information about DHCP.

First, most modern printers support the ability to boot across the network from a BOOTP or DHCP server. This method works well in environments with many homogeneous printers.

Alternatively, all network printers allow you to set their IP address from the console. Sometimes the “console” is a serial port, but often it’s just a scheme for using buttons on the front of the printer. After your printer is on the network and you can ping it, make sure to secure it as discussed on page 742.

To make the following sections more fluid, we talk about a consistent set of hardware. The server beast is a generic lpd spooler attached to a PostScript laser printer named howler-lw.

Adding printers to Solaris


With Solaris 2.6, Sun introduced yet another printing system. The best way to administer printing under Solaris is

Return Main Page Previous Page Next Page

®Online Book Reader