[Previous Section] [Back to Table of Contents] [Next Section]

IRIX Advanced Site and Server Administration Guide


Chapter 9
Administering Printers

One of the basic peripheral devices used by almost all workstations and servers is a printer. This chapter deals with installing and maintaining a printer with your IRIS workstation or server. Most computing facilities use printers regularly. Your IRIS supports many industry-standard printers.

The most convenient way for you to install a printer on your IRIS is to use the graphical System Manager. This method of adding a printer is described in the Personal System Administration Guide. If you have a non-graphical workstation or server, you can use this chapter for instructions on how to administer your printing system using IRIX shell commands. In this chapter, the terms ``workstation'' and ``server'' are used interchangeably, because the interface described here is identical across all Silicon Graphics products.

The lp system allows information to be printed and is one of the main utilities that users need on a regular basis. This chapter discusses:


Adding a Printer

To send print requests to your printer, you must first add your printer by registering it with the line printer (lp) spooler. The printer should be registered with the lp spooler of the computer to which the printer is directly connected (hardwired), and also with the lp spooler of any computer accessing the printer through a network. The procedures for registering a printer with lp vary, depending on whether the printer is hardwired or accessed across a network; these procedures are described in the next sections.

Registering Parallel and SCSI Printers

There are several different types of printers you can connect to your system. In this chapter, printers are divided into three groups. The first group is parallel and SCSI printers. The second are serial printers and the third group is printers of any type connected to other systems. The printer hardware documentation should tell you whether your printer is a parallel or serial printer.

If you need to create the devices to use your parallel port or ports (some systems, such as CHALLENGE and Onyx series have multiple parallel ports), log in as root and use the commands:

cd /dev 
./MAKEDEV plp 

The MAKEDEV script will determine the number of parallel ports on your system (there is always at least one) and make the correct devices for all available ports.

The parallel interface port on the back of your workstation or server is clearly labeled. The special file /dev/plp refers to the parallel printer interface and port. Some larger servers and workstations can have multiple parallel ports. There is one parallel port on each IO4 board on CHALLENGE and Onyx systems. If you have four IO4 boards, you have four parallel ports.

If you have more than one parallel port on your system, the device files that refer to the ports are named according to the board slot in which the CPU board is installed. For example, if you have an IO4 board in slot 2 and another in slot 4, the device files for the parallel ports will be /dev/plp2 and /dev/plp4. One of these devices (the parallel port attached to the board designated as the primary board) will be linked to the default /dev/plp. Each parallel port on the back of your system is clearly labeled.

Parallel and SCSI printers are installed with the same procedure, but to different ports. Your SCSI printer hardware documentation should detail the cabling requirements for SCSI interface. Most printers can be installed using the graphical System Manager and the procedures described in the Personal System Administration Guide. The procedure below is for those systems without access to the System Manager.

To register printers connected directly to your computer via the parallel or SCSI ports, follow these steps:

    Become the superuser with the su(1M) command.

    To stop the print spooler, type:

    /usr/lib/lpshut 

    Assuming you have a raster printer attached to the parallel port, use the mkcentpr(1M) utility to install the printer in the lp system:

    mkcentpr 

    The mkcentpr utility is an interactive script that will prompt you for all necessary information about your printer. You should be prepared to specify the device file for the parallel port (/dev/plp unless you have multiple CPU boards installed) and other specific information. Consult the mkcentpr(1M) reference page for complete information about mkcentpr syntax.

    To set up this printer as the default printer, type:

    /usr/lib/lpadmin -dprinter-name 

    To restart the print spooler, type:

    /usr/lib/lpsched 

Your printer is now registered with the lp system and is ready for printing.

Registering Serial Printers

If you have a graphics system, the best way to add a serial printer is to use the System Manager provided with the Operating System. Servers and other non-graphics users use the lpadmin(1M) command. To add a printer to port 2 on your system, perform the following steps:

    To stop all printer activity on your system for the duration of this procedure, give the command:

    lpshut

    To define the printer interface for the new device, give the following command:

    lpadmin -p printer-name -m model -v /dev/ttyd2 

    where model is a type of printer listed in the /var/spool/lp/model file.

    To make the new printer the default destination for your lp(1) print jobs, give the command:

    lpadmin -d printer-name To enable the printer to receive requests, give the command:
    enable printer-name 

    To enable lp to process requests for this printer, give the command:

    /usr/lib/accept printer-name 

    Finally, restart printer activity on your system with the command:

    /usr/lib/lpsched 

Registering Network Printers

The most convenient way for graphical workstation users to add a network printer is to use the graphical System Manager. The Print Manager utility is described in detail in the Personal System Administration Guide.

To configure a printer for use across a network using IRIX shell commands, follow these steps:

    Log in as the superuser to the workstation with the attached printer.

    Replace remote_workstation in the command below with the name of the workstation that needs access to the printer. Type:

    addclient remote_workstation 

    addclient grants permission for the specified remote_workstation to access printers across the network. It is important to realize that by giving this command, you are allowing anyone on the remote machine who has access to the lp account there to have the privileges of the lp account on your system.

    If you want all remote workstations to be able to use printers on your system, type:

    addclient -a 

    Note: Printers must be configured on the system to which they are attached before remote workstations can configure them successfully across the network.

    Both workstations must be able to communicate across the network. For additional information on network communications, see Chapter 15, "Understanding Silicon Graphics' Networking Products."

    On the local workstation, become superuser.

    To stop the spooler, type the command:

    /usr/lib/lpshut 

    On the local workstation, add the printer to the lp spooler with the script mknetpr:

    mknetpr printer hostname netprinter 

    printer is the local name you want for the remote printer and should be no more than 14 characters long. hostname is the name of the workstation or server the remote printer is on, and netprinter is the name of the printer on that workstation or server.

    To set up this printer as the default printer, type this command on the local workstation:

    /usr/lib/lpadmin -dprinter-name 

    Restart the spooler with this command:

    /usr/lib/lpsched 


Removing Printers

Under some circumstances, you may want to remove one or more printers from the lp system. The rmprinter(1M) utility allows you to remove a specified printer. The preset(1M) utility allows you to reset your entire lp system to the way it was when you received your workstation from Silicon Graphics, Inc. To remove a specified printer, follow these steps:

    Become the superuser.

    Remove the printer by entering the command below. Replace printer-name with the name of the printer you wish to remove:

    rmprinter printer-name 

Your printer is now removed from the lp system.

To remove all printers on your system, use the preset command.

Caution: Use preset with extreme care: it removes all printer configuration information.

    Become the superuser.

    Type:

    preset 

Your lp system is now completely reset and all printers are removed.


Using the lp Spooler

The Line Printer (lp) Spooling Utilities are a set of eleven commands that allow you to spool a file that you want to print. Spooling is a technique that temporarily stores data until it is ready to be processed (in this case, by your printer). For lp spooling, a file (or group of files) to be printed is stored in a queue until a printer becomes available. When the printer is ready, the next file in the queue is printed.

lp spooling allows you to use your workstation without waiting for your file to print. lp spooling also lets you share printers among many users. The flow of printing throughout your system is regulated by the lp Spooling Utilities.

The lp Spooling Utilities allow:

The eleven lp spooling commands are divided into two categories: user commands for general use of the lp system; and administrative commands for system configuration and maintenance.

lp Terms and Conventions

These terms represent important concepts used in this document:

printer

A logical name that points to an interface file, which represents a physical device, that is, the actual printer.

class

The name given to an ordered list of one or more printers. A printer may be assigned to more than one class, but need not be a member of any class.

destination

The place an lp request is sent to await printing. The destination may be a specific printer or a class of printers. An output request sent to a specific printer will be printed only by that printer; a request sent to a class of printers will be printed by the first available printer in its class.

lp User Commands

The commands described in this section allow all users on your workstations and your network to access the printing facilities. Your users should use the lp and cancel commands most frequently, the lpstat command occasionally, and the enable and disable commands infrequently, if ever.

User Command Summary

This section describes the five basic lp commands.

lp

Routes jobs to a destination and places them in a queue. The destination may be either a single printer or a class of printers.

cancel

Cancels output requests.

disable

Prevents a printer from printing jobs in the queue.

enable

Allows a printer to print jobs in the queue.

lpstat

Reports the status of many aspects of the lp spooling system.

lp: Make an Output Request

The lp command routes a job request to a destination where it is placed in a queue to await printing. The destination may be a single printer or a class of printers. If you do not specify a destination, the request is routed to the default destination. For information on how to set the default printer destination, see "Changing the Default Printer Destination"

The form of the lp command is:

lp [options] filenames 

Every time an lp request is made, a ``request-ID'' is assigned to the job, and a record of the request is sent to you. The request-ID has this form:

destination-seqnum 

destination is the printer or class of printers to which the job has been routed. seqnum is an arbitrary sequence number assigned to the job by the lp system.

lp has three options which are particularly useful: -n, -d, and -c.

Use -n to print more than one copy of a document:

lp -nnumber 

number is the number of copies to print. Note that there is no space between -n and number.

Use -d to specify a printer or class of printers other than the default printer (assuming your system has more than one printer defined):

lp -ddestinationfilenames

Finally, use -c (for copy) to ensure that the edits that you make to your files once you have issued a print request do not show up in the printed output:

lp -c filenames 

You can combine these command options in any order. For a complete list of lp options, see the lp(1) reference page. Some example uses of the lp command are shown here:

lp myfile 
request id is myprinter-12 (1 file) 
lp < myfile 
request id is myprinter-13 (standard input)
cat myfile | lp 
request id is myprinter-14 (standard input)
lp -n3 -dfoo -c myfile 
request id is foo-15 (1 file) 

To request a printout, you can use the lp command several different ways. The first three examples above perform identical functions, sending a simple print request to the default printer. The fourth example prints three copies on printer foo and creates a copy of the file for the printer to process, ensuring that if changes are made to the file after the print request, the original file will be printed.

cancel: Stop a Print Request

The cancel command removes a job from the queue. You can cancel a job either before or after it starts printing, but you can cancel only one at a time.

Any user can cancel any other user's job. If you cancel another user's print request, mail is sent to that user. Once you cancel a job, you can request that it be printed again only with the lp command:

cancel printer-name

cancel request-ID 

Using the printer name cancels the job currently being printed. Using the request-ID cancels the specified job whether or not it is currently being printed, as shown below:

cancel myprinter 
request "myprinter-16" cancelled 
cancel myprinter-17 
request "myprinter-17" cancelled 

Issuing a cancel command does not work when the job is being printed on a remote workstation. To cancel a print job on a remote system, log in to the remote system and issue the cancel command.

disable: Stop Printer from Processing Requests

The disable command prevents the printer from printing jobs in the queue. Possible reasons for disabling the printer include malfunctioning hardware, paper jams, running out of paper, or end-of-day shutdowns. If a printer is busy at the time it is disabled, the request it was printing is reprinted in its entirety when you re-enable the printer.

You can send job requests to a printer that has been disabled. The jobs are put on the queue but are not printed until the printer is enabled.

To disable a printer, type:

disable [-c] [-r"reason"] printer(s) 

The -c option cancels the request currently being printed and disables the printer. This is useful if the current request causes the printer to behave abnormally.

The -r option lets you tell other users why you disabled a printer. reason is a character string and must be enclosed in double quotes (" "). This string is reported to anyone trying to use the disabled printer or to anyone issuing the lpstat(1M) command.

enable: Allow Printer to Process Requests

The enable command permits a printer that has been disabled to begin printing jobs from the queue. The example below demonstrates the enable command. To enable a printer, type:

enable printer(s) 
disable -r"paper jam" myprinter 
printer "myprinter" now disabled 
enable myprinter 
printer "myprinter" now enabled 

lpstat: Report lp Status

The lpstat command gives you a report on the status of various aspects of the lp system. To check lp status, type:

lpstat [options]

The most useful option is -t, which gives a complete report on the status of the lp system. For a complete list of options, see the lpstat(1) reference page. The following example demonstrates the lpstat command:

lpstat -t 
scheduler is running 
system default destination: myprinter 
members of class foo: 
myprinter 
device for myprinter: /dev/plp 
myprinter accepting requests since Jul 31 21:40 
foo accepting requests since Jul 30 12:23 
printer myprinter now printing foo-18 
enabled since Aug 5 15:34 
foo-18 mylogin 3156 Aug 7 17:11 on myprinter 

Administrative Commands

This section summarizes the commands that are used to administer the lp system. To execute the administrative commands, you must be logged in as either root (that is, the superuser) or as lp. Inexperienced users should not use the lp administrative commands.

Administrative Command Summary

lpsched

Starts the lp scheduler.

lpshut

Stops the lp scheduler.

reject

Prevents jobs from queueing at a particular destination.

accept

Permits job requests to queue at a particular destination.

lpmove

Moves printer requests from one destination to another.

lpadmin

Configures the lp system.

lpsched : Start the lp Scheduler

The lpsched command starts the lp scheduler. lp prints jobs only when the scheduler is running. lpsched is executed automatically each time the computer is booted.

Every time lpsched is executed, it creates a file called SCHEDLOCK in /var/spool/lp. As long as this file exists, the system will not allow another scheduler to run. When the scheduler is stopped under normal conditions, SCHEDLOCK is automatically removed. If the scheduler stops abnormally, you must remove SCHEDLOCK before you use the lpsched command. You may need to use this procedure to restart the scheduler after the system shuts down abnormally.

To start the lp scheduler, type:

/usr/lib/lpsched 

There is no response from the system to acknowledge the lpsched command; to verify that the scheduler is running, use lpstat.

lpshut: Stop the lp Scheduler

The lpshut command stops the lp scheduler and ends all printing activity. All requests that are being printed when you issue the lpshut command are reprinted in their entirety when the scheduler is restarted.

To stop the lp scheduler, type:

/usr/lib/lpshut 

reject: Prevent Print Requests

The reject command stops lp from routing requests to a destination queue. For example, if a printer has been removed for repairs, or has received too many requests, you may wish to prevent new jobs from being queued at that destination.

If the printer is enabled, all requests that are in the queue when you issue the reject command are printed.

The reject command takes the form:

/usr/lib/reject [-r"reason"] destination 

The -r option lets you tell other users why print requests are being rejected. reason is a character string and is enclosed in double quotes (" "). This string is reported to anyone trying to use lp to send requests to the specified destination.

accept : Allow Print Requests

The accept command allows job requests to be placed in a queue at the named printer(s) or class(es) of printers. As shown in the example below, accept allows a printer to receive job requests and reject disables printing:

/usr/lib/accept myprinter 
destination "myprinter" now accepting requests 
/usr/lib/reject -r"printer broken" myprinter 
destination "myprinter" is no longer accepting requests 

lpmove: Move a Request to Another Printer

The lpmove command moves print requests from one destination to another. For example, if you have a printer removed for repairs, you may want to move all jobs pending on the queue to a destination with a working printer. You may also use lpmove to move specific requests from one destination to another, but only after you have halted the scheduler with the lpshut command. lpmove automatically rejects job requests re-routed to a destination without a printer. The lpmove command takes two forms:

/usr/lib/lpmove dest1 dest2 
/usr/lib/lpmove request(s) destination 

dest1, dest2, and destination are printers or classes of printers. request is a specific request-ID.

In the first form of the command, all requests are moved from dest1 to dest2. After the move, the printer or printers at dest1 will not accept requests until you issue an accept command. All re-routed requests are renamed dest2-nnn, where nnn is a new sequence number in the queue for destination dest2. In the second form, which you may issue only after you stop the scheduler, the re-routed requests are renamed destination-nnn. When you restart the scheduler, the original destinations will still accept new requests. The three commands in the example below demonstrate the usage of the lpmove command:

/usr/lib/lpmove myprinter yourprinter 
lpshut 
/usr/lib/lpmove foo-19 foo-20 yourprinter 

After the third command, you see the message:

total of 2 requests moved to yourprinter 

lpadmin: Configure Printers

The lpadmin command has two primary uses: adding new printers to the system and changing printer classes and destinations. Silicon Graphics has some routines to automatically add some of the printers supported for use with the workstation. These commands include mkPS(1M), mkcentpr(1M), and mknetpr(1M). These should be used whenever possible. For a list of supported printers, see the file /var/spool/lp/model.

Unlike most IRIX commands, lpadmin requires an option. The lpadmin command takes three forms:

lpadmin -ddestination 
lpadmin -xdestination 
lpadmin -pprinter [options] 

The -d option sets the system default destination. The destination must already be installed when you issue the command.

The -x option removes the specified destination from the lp system. This form of the lpadmin command will not work while the scheduler is running.

You cannot remove a destination (printer or class) if it has pending requests; you must first either remove all requests with the cancel command or move them to other destinations with lpmove.

Removing the last remaining member of a class deletes that class from lp. Removal of a class, however, does not imply the removal of printers assigned to that class.

The -p form of the lpadmin command has two options that let you reassign printers to different classes. With these options, the lpadmin command takes the form:

lpadmin -pprinter [-cclass] [-rclass] 

The -c option assigns a printer to the specified class; the -r option removes a printer from the specified class.

/usr/lib/lpadmin -xmyprinter 
/usr/lib/lpadmin -dmyprinter -rfoo -cboo 

The -p options will not work while the scheduler is running. For a complete list of options, see the lpadmin (1M) reference page. After creating a printer, you may need to edit the interface file: /var/spool /lp/interface/printername. The interface file controls such things as printer baud rate, log file site, and existence of banners.


Maintaining the lp System

This section contains procedures for changing your default printer, clearing printer log files, and printing over a network.

Changing the Default Printer Destination

The lp command determines a request's destination by checking for a -d option on the command line. If -d is not present, it checks to see if the environment variable LPDEST is set. If LPDEST is not set, then the request is routed to the default destination.

The system default destination can be a printer or a printer class.You can set it by using the lpadmin command with the -d option. The system default must be set by the user. A destination must already exist on the lp system before you can designate it as the default destination.

Setting the environment variable LPDEST allows a user to have a default destination other than the system default.

Clearing Out log Files

A log file keeps a record of all printing activity on a given printer. Each printer keeps a log file, located in /var/spool/lp/transcript/log. You can change the name of the file by editing /var/spool/interface/printername and changing the value of the LOGFILE variable.

Each file contains a running list of processed jobs, each of which includes the following:

Any lpsched error messages that occur are also recorded.

If there are a lot of lp requests for a given printer, that printer's log file will soon get very large. You can manually remove the contents of these files from time to time, or you can set up the computer to do it for you automatically at regular intervals.

Included in /var/spool/lp/etc/lib is a shell script log.rotate that automatically rotates (cleans out) your printers' log files once per day at 4:12 a.m. To set up the script for your printer(s), you must edit log.rotate and /var/spool/cron/crontabs/root in the following manner:

    Become the superuser and change directories to /var/spool/lp/etc/lib:

    cd /var/spool/lp/etc/lib 

    In the file log.rotate, remove the comment marker (#) from the following line:

    # printers="PRINTER1 PRINTER2" 

    In place of PRINTER1 and PRINTER2, put the names of any parallel-interface (that is, color) printers and any remote printers. Any number of printers may be included. If you have no color or remote printers, use two double quotes to make a null string (" ") in place of the printer names.

    In the file log.rotate, remove the comment marker (#) from the following line:

    # LocalPS="PRINTER1" 

    In place of PRINTER1, put the names of any hardwired (that is, connected to the serial port) printers.

    Change directories to /var/spool/cron/crontabs:

    cd /var/spool/cron/crontabs 

    Edit root by removing the comment marker (#) from the line containing log.rotate.

    Write and exit from the file. The lp log will be rotated by the script log.rotate, which is called by the cron daemon.

    For more information about using cron to automate tasks, see "Automating Tasks with at(1), batch(1), and cron(1M)".

Printing Over the Network

Remote printing on the workstation or server allows you to send print jobs over the network with the same commands you use to send jobs to a printer connected directly to your workstation. This is accomplished by giving a remote printer a local name so that the local lp scheduler is ``fooled'' into thinking it is sending the request to a local printer. After the local workstation's lp spooler queues the print request, it is sent across the network to the remote workstation or server, where it is processed by that workstation's lp spooler. As a result of this, you cannot accurately determine the status of a remote print request by using the lpstat command on the local workstation.

This section covers two aspects of remote printing:

Checking Remote Printer Status

When you send a print request across the network to a remote workstation, the local lp system always reports that the request is being printed, regardless of its actual status in the remote workstation's lp system. To check the true status, you must remotely access (using rsh or rlogin) the workstation whose printer is processing the job. The remote lp scheduler changes the request ID of any job sent to it over the net to reflect the actual name of the printer and gives it a new sequence number corresponding to its place in the remote queue. To determine a specific job's status, look in the remote printer's log file (that is, the log file on the remote workstation) with the tail command. The example below uses rsh to access the remote workstation:

rsh hosttail logpath

host is the name of the remote workstation. logpath is the pathname of the remote printer's log file.

Canceling Remote Print Requests

Once you know the remote printer status, you can use the cancel command on the remote workstation to cancel any jobs on the printer's queue. You must cancel a remote print job from the remote workstation once it has been sent over the network by the local lp system.


Troubleshooting Your Printing System

If you send a print request to a printer with lp, psroff, or imprint and do not receive any output, you should use the checklists below to make sure your system is ready for printing. Use these lists as a supplement to the troubleshooting information in the manufacturer's hardware manual.

Hardware Troubleshooting Checklist

Use the following list of questions to determine if your printer hardware is working as designed:

Software Troubleshooting Checklist

The lp scheduler is the program in charge of spooling your files to the printer, and it is invoked whenever you use the lp, psroff, or imprint print commands. The scheduler can be in a number of states, and each printer registered with lp can be in a number of states as well.

To check on the complete status of the lp system, type:

lpstat -t 

This gives you a complete description of the status of lp. You may also want to examine the contents of the file /var/spool/lp/log. Use the information you find to answer the following questions:

Troubleshooting Network Printers

If you are having trouble with a printer you are accessing over a network, you should check the status of the lp scheduler on your workstation and the printer's host workstation.

Emergency Measures

If none of the above procedures works, there are several ``last resort'' procedures:

    Stop the lp scheduler and then restart it. As root, type the following sequence of commands:

    /usr/lib/lpshut 

    Then kill any jobs running as lp. You can identify these processes with the command:

    ps -fu lp

    Then give the command:

    /usr/lib/lpsched 

    Remove the offending printer destination from the lp scheduler, and then register it again. Before you can do this you must either cancel any print requests going to the printer or move them to another print destination (if you have more than one).

    As an absolute last resort, remove all printers from the lp system, reboot the computer, and register them all once again.


lp Error Messages

This section provides a description of the error messages that are associated with lp commands. The following variables are used in the error messages:

file(s)

Indicates the file or files that are to be printed.

dest

Indicates the name of the destination printer.

printer-id

Indicates the request identification number of the printout. For example, myprinter-46 is the printer name followed by the request identification number.

printer-name

Indicates the name of the printer.

program-name

Indicates the program name that was executed.

user

Indicates the user who requested the printout.

These messages can be found in the printer log files if you miss them on the system console. Following each message is an explanation of the probable cause of the error and the corrective action to take. If you are not able to correct all the error conditions you encounter, call your service representative for assistance.


Printer Cable Pin Signal Tables

Your workstation or server has one or more serial ports and one or more parallel ports. The serial ports on your system are either DB-9 format or Mini-DIN8. The parallel port is the industry standard 25-pin parallel port. For your use in determining correct cabling, the following sections provide pin signal tables for the serial and parallel ports on your system.

Parallel Port Pin Signal Table

The parallel port on your system uses industry standard parallel printer cables to connect to common printers. It is recommended that you use a parallel cable no longer than 10 feet. Using a parallel hookup usually results in faster printing from your system. Also, because serial ports are generally more in demand for modems, terminals, and other peripheral devices, using the parallel port, when possible, saves a serial port for other uses.

Table 9-1 shows the parallel port pin signal table for IRIS systems:

Table 9-1 : Parallel Port Pins and Signals

Pin Signal
1 STB
2 DATA1
3 DATA2
4 DATA3
5 DATA4
6 DATA5
7 DATA6
8 DATA7
9 DATA8
10 ACK
11 BUSY
12 PE
13 ONLINE
14 PR/SC
15 FAULT
16 RESET
17 NO INK
18 NC*
19-25 Signal Ground



*NC stands for "no connect," meaning the wire is not used.

Serial Port Pin Signal Tables

The serial port on your workstation or server is either a DB-9 (9 pin) or a Mini-DIN8 port. In either case, the port is clearly labeled as a serial port. Consult your hardware Owner's Guide to determine which kind of port your system has. There are 2 basic printer cable configurations for the DB-9 serial ports and one for the Mini-DIN8 serial port. Depending on the cables used some serial functionality may be sacrificed due to unconnected wires in the cable. Note that the pinout of the DB-9 connectors is different than that of the full size DIN connectors that may be next to them. These DIN connectors also have different pinouts than the Mini-DIN8 connectors used on some systems and documented in this section. The DB-9 and full size DIN connectors are connected to the same internal port hardware.

DB-9 Connector Cabling

For most serial printers, you should use the following cable. This cable uses the normal 3-wire connection and be used as a /dev/ttyd* device. Table 9-2 shows typical DB-9 serial cabling:

Table 9-2 : DB-9 Serial Cable

Function DB-9-Male DB25-Male
TXD 1 nc*
RXD 2 3


3 2


4 nc


5 nc


6 nc
GND 7 7
DCD** 8 20


9 nc



*nc stands for "no connect," meaning the wire is not used.

** DCD is only used with /dev/ttym* devices if the system must notice when the printer powers off. Normally it is not used.

Note: Do not use a cable designed for an IBM PC/AT® compatible 9-pin connector. It does not work correctly with your workstation.

For printers using RTS/CTS hardware flow control, the following pin-out allows ``full flow control.'' This cable is required to implement /dev/ttyf* devices. This cable also supports /dev/ttym* devices. Table 9-3 illustrates the correct pin-out for these devices:

Table 9-3 : DB-9 RTS/CTS Flow Control Cable

Function DB-9-Male DB25-Male


1 nc
TXD 2 2
RXD 3 3
RTS* 4 4
CTS* 5 5


6 nc
GND 7 7
DCD 8 8
DTR 9 20



* RTS and CTS are ignored (optional) if using /dev/ttym* but required if using /dev/ttyf*

Note: This cable can be used with a null modem adapter for printers, however it is recommended that you use this cable exclusively for modem connections. The IBM PC/AT to modem cable (``off the shelf cables'') does not work properly with your workstation. For additional information, see the serial(7) reference page.

Mini-DIN8 Connector Cabling

Many workstations and servers use the Mini-DIN8 serial port. Check your hardware Owner's Guide to see if your system supports this type of connection. Note that the pinout of these Mini-DIN8 connectors is different than that of the DIN connectors on larger systems. These larger systems also have DB-9 connectors that are connected to the same internal port hardware.

For most serial printers you should use a commercially available cable, "Macintosh SE® to Imagewriter1®." This cable uses the normal 3-wire connection and is used as a /dev/ttyd* device. Table 9-4 shows the pin configuration:

Table 9-4 : Mini-DIN8 Serial Cable

Function Mini-DIN8-Male DB25-Male


1 nc
TXD 2 nc
GND 3 3
RXD 4 7


5 2
DCD* 6 nc
GND 7 20


8 7



* /dev/ttym* devices should be used with this cable only if the system must notice when the terminal or printer is powered off.

Note: A Macintosh SE cable also has some other pins connected, but they can be ignored.


Configuring and Troubleshooting the BSD LPR Spooler System

Silicon Graphics does not support configuring the BSD lpr print spooler locally (you cannot have the printer physically connected to a Silicon Graphics system). If you want to use the system as a print server, you will need to refer to "Adding a Printer".

The purpose of this section is to show by example how to configure any Silicon Graphics computing system so that you will be able to submit and print your files on the BSD print server.

The BSD lpr print spooler will allow you to access printers that are attached to other systems on the network. Please be sure to check the other systems, or contact the System Administrator, to verify the type of spooling system those systems are using. Generally speaking, if a system has an /etc/printcap file configured, it is using the BSD lpr print spooling system.

Note: Do not use the Printer Tool (accessed through the System toolchest or from the System Manager menu) to configure a BSD lpr spooling system. Also, do not use the mknetpr(1M) command for configuring a network printer. These utilities support only the System V LP Spooling System.

Please verify that the System Administrator of the print server includes your hostname in their /etc/hosts.equiv file, and that your IP address and hostname appear in their /etc/hosts file. You will need to add the print servers IP address and hostname to your /etc/hosts file. If your files (documents) do not print once you have configured the BSD print spooler, please see "Troubleshooting the BSD LPR Spooling System". The troubleshooting section will take you to the point where you can see a copy of your document on the print server. If the document disappears from the server's queue without printing, contact the System Administrator of that system for further assistance.

Verifying Installation of the BSD LPR Subsystem

Enter the following command to verify that the BSD lpr print spooling system was properly installed:

versions long | grep eoe2.sw.bsdlpr 

Your output should be:

eoe2.sw.bsdlpr etc/init.d/lpd eoe2.sw.bsdlpr etc/printcap eoe2.sw.bsdlpr etc/rc0.d/K26lpd eoe2.sw.bsdlpr etc/rc2.d/S61lpd eoe2.sw.bsdlpr usr/bsd/lpq eoe2.sw.bsdlpr usr/bsd/lpr eoe2.sw.bsdlpr usr/bsd/lprm eoe2.sw.bsdlpr usr/bsd/lptest eoe2.sw.bsdlpr usr/etc/lpc eoe2.sw.bsdlpr usr/etc/lpd eoe2.sw.bsdlpr usr/etc/pac eoe2.sw.bsdlpr usr/lib/lpf eoe2.sw.bsdlpr usr/spool/lpd

The BSD spooler is not loaded by default. Check to see if the subsystem is installed. If not, then refer to the Software Installation Administrator's Guide and/or your release notes. Most users will have to use the inst(1M) command and then select the manual option to install this subsystem.

Please use the versions command (versionslong|greplpr) to verify that you have the entire subsystem loaded. Loading only the /etc/printcap file is not sufficient.

After you verify that the eoe2.sw.bdslpr subsystem is properly installed, you will need to edit the /etc/printcap file to configure the lpr spooling system. There are no tools to perform this function, so you will need to edit the file manually. The remainder of this article will take you through this process. Please ensure that you format the entries correctly. The /etc/printcap file expects information in a format similar to the /etc/termcap file.

Configuring the Printcap File

Before you begin editing the /etc/printcap file, login to your system as root.

Note: The printcap file is very sensitive to syntax errors. The name field must begin at the first character on a line of the /etc/printcap file. The printer names must be separated by pipe symbols (the vertical bar "|"). The name line must be terminated with a colon followed by a backslash (":\"). Make sure that there are no spaces, tabs, or any other character after the backslash.

The definition lines must begin with a tab character followed by a colon (:), followed by the field you are defining, followed by an equal sign. The definition line must end with a colon. See "Printcap Examples".

There is only one name and three definition fields that must be defined. They are:

name

This field should contain all the names the printer will be accessed as. It should include lp because, by default, lpr looks for lp in the name field of the /etc/printcap file. The names are separated with pipe symbols.

:rm

Remote machine name. This is the name of the system that has the printer physically connected to it.

:rp

Remote printer name. This is the name of the remote printer on the remote system that you are trying to access.

:sd

Spool directory. This is the name of your local spool directory. If you don't use the default directory, /usr/spool/lpd, you will need to create the directory by using the mkdir(1M) command.

Printcap Examples

Following are two examples that will help you to edit the /etc/printcap file. The first example will show you how to configure the printer configuration file in two lines. The second example will show you how to configure each option of the printcap file on separate lines. There will be explanations of both examples.

Printcap Example1

lp|sleepy|sleepyprinter:\ 
:lp=:\:rm=snowwhite.story.land:rp=doc:sd=/usr/spool/lpd:

This example can access the printer by the following names:

lp 
sleepy 
sleepyprinter

The remote system (where the printer is physically attached) is called: snowwhite.story.land

The name of the printer on the print server (remote system) is called: doc

The local spool directory is called /usr/spool/lpd

Printcap Example2

lp|sleepy|sleepyprinter:\
 :lp=:\
 :rm=snowwhite.story.land:\
 :rp=doc:\
 :sd=/usr/spool/lpd:

This example can access the printer by the following names:

lp 
sleepy
sleepyprinter

The remote system (where the printer is physically attached) is called: snowwhite.story.land

The name of the printer on the print server (remote system) is called: doc

The local spool directory is called /usr/spool/lpd

Using the lpr Command to Print

Now that you have the /etc/printcap file configured, make sure that the daemon is running. Enter the following command:

ps -ef | grep lpd 

Your system should return something similar to:

root 195 1 0 11:06:04 ? 0:00 /usr/etc/lpd 
root 1293 753 2 13:20:39 ttyq6 0:00 grep lpd

The /usr/etc/lpd path at the end of the line indicates that the daemon is running. If only one line was returned (grep lpd), then start the lpd daemon by entering the following command:

/usr/etc/lpd 

Now if you type, ps-ef|greplpd, you should see 2 lines returned to you.

As shown in "Printcap Examples" above, note that the printer could be accessed by three names; lp, sleepy and sleepyprinter. By default, the lpr command will look for the field, lp, in the /etc/printcap file. If this is not the first name in the name field, then you will need to do one of two things:

Whenever you enter the lpr command you must use the -P option to specify a printer name other than lp.

lpr -Psleepyprinter filename 

Alternately, in your shell you can set the environment variable PRINTER to the name of the printer you wish to use.

In the C shell:

setenv PRINTER sleepy 

In the Bourne shell:

PRINTER=sleepy; export PRINTER 

Now you can enter the command:

lpr filename 

After submitting your request to the printer, you can see if your job has made it to the print spooling queue by entering the following command:

lpq 

Your system should return something similar to:

lp is ready and printing 
Rank Owner Job Files Total Size 
1st nina 113 filename 851 bytes

Troubleshooting the BSD LPR Spooling System

If your print request does not make it to the queue, then:

The file you submitted may not be in the proper format for the printer to print your request.

If your print request makes it to the queue and never gets to the print server, then:

This usually means that your hostname is not in the print servers /etc/hosts.equiv file. If your print request disappears from the queue, and doesn't print or prints incorrect information, then:

    Become root and enter the commands:

    /usr/etc/lpc stop lp (or your printername) 
    lpr /etc/group 
    cd /usr/spool/lpd (or your spool directory) 
    ls -l 

    Your system should return something similar to:

    -rw-rw---- 1 root lp 69 Aug 23 14:02 cfA117tls 
    -rw-rw---- 1 root lp 227 Aug 23 14:02 dfA117tls 
    -rwxr----- 1 root lp 0 Aug 23 14:01 lock 
    -rw-rw-r-- 1 root lp 25 Aug 23 14:46 status

    Check the contents of the control file with the following command:

    cat cfA117tls 

    Your system should return something similar to:

    Htls H the hostname that sent the print request 
    Proot P the person who sent the request 
    Jgroup J the jobname 
    Ctls C class/hostname 
    Lroot L the person who sent the request 
    fdfA117tls f name of the file to print 
    UdfA117tls U name of the file to remove after printing 
    N/etc/group N the original file name

    Check the copy of the print file.

    We recommend that you use the more(1) command just in case your test file is not as short as the /etc/group file. The df file should look exactly like the file you attempted to print. In this case the file dfA117tls should be exactly the same as the /etc/group file.

    more dfA117tls 

    The system should return something similar to:

    sys::0:root,bin,sys,adm 
    root::0:root 
    daemon::1:root,daemon 
    bin::2:root,bin,daemon 
    adm::3:root,adm,daemon 
    mail::4:root 
    uucp::5:uucp 
    rje::8:rje,shqer 
    lp::9: 
    nuucp::10:nuucp 
    user::20: 
    other::995: 
    demos:*:997: 
    guest:*:998:

Now that you have verified that the request is properly spooling on the local system, check the print server. First, you may need to contact the system administrator of the print server. You will need the root password, and once you enter the stop command on their system no one will see their print request print. It will just remain in the queue. Make sure that there are no requests in the queue that are currently printing. It would be ideal if there were no requests currently in the queue.

    On the print server log in as root and enter the command:

    /usr/etc/lpc stop lp 

    On the local system enter the command:

    /usr/etc/lpc start lp 

    On the print server, cd to the spool directory.

    If you do not know where the spool directory is, cat(1) or more(1) the /etc/printcap file and look at what is set in the sd: variable.

    On the print server (after step 6), enter the following command:

    ls -l 

    The print server should return something similar to:

    -rw-r----x 1 root 4 Aug 15 10:27 .seq 
    -rw-rw---- 1 root 69 Aug 23 14:02 cfA117tls.csd.sgi.com 
    -rw-rw---- 1 root 227 Aug 23 14:02 dfA117tls 
    -rwxr------ 1 root 0 Aug 23 14:01 lock 
    -rw-rw-r-- 1 root 25 Aug 23 14:46 status

    Check the contents of the control file.

    cat cfA117tls.csd.sgi.com 

    The print server should return something similar to:

    Htls H the hostname that sent the print request 
    Proot P the person who sent the request 
    Jgroup J the jobname 
    Ctls C class/hostname 
    Lroot L the person who sent the request 
    fdfA117tls f name of the file to print 
    UdfA117tls U name of the file to remove after printing
    N/etc/group N the original file name

    Examine the df* file by entering the following command:

    more dfA117tls 

    The system should return something similar to:

    sys::0:root,bin,sys,adm 
    root::0:root 
    daemon::1:root,daemon 
    bin::2:root,bin,daemon 
    adm::3:root,adm,daemon 
    mail::4:root 
    uucp::5:uucp 
    rje::8:rje,shqer 
    lp::9: 
    nuucp::10:nuucp 
    user::20:
    other::995: 
    demos:*:997: 
    guest:*:998:

    The df file should look exactly like the file you attempted to print. In this case the print servers dfA117tls file should be exactly the same as the dfA117tls file that was on your system.

    On the print server enter the following command:

    /usr/etc/lpc start lp 

    Your file should now print on the printer. It should look exactly like the output of the more command. If it doesn't then contact the System Administrator of the print server.


[Previous Section] [Back to Table of Contents] [Next Section]


Send feedback to Technical Publications.

Copyright © 1997, Silicon Graphics, Inc. All Rights Reserved. Trademark Information