System Administration Guide, Volume II
  Procure somente este livro
Fazer download desta apostila em PDF

Troubleshooting Printing Problems

52

This chapter explains how to troubleshoot printing problems that may occur when you set up or maintain printing services.
If you want to skip the background information that explains the concepts of troubleshooting printing problems and proceed directly to step-by-step instructions, use the following list to find the page where the instructions for a specific task begin.
How to Troubleshoot No Outputpage 1037
How to Troubleshoot Incorrect Outputpage 1060
How to Unhang the LP Commandspage 1065
How to Troubleshoot an Idle (Hung) Printerpage 1066
How to Resolve Conflicting Status Messagespage 1068
For pointers on troubleshooting print problems, see "Tips on Troubleshooting" on page 1030.
For additional information about printing, refer to the following chapters:

Tips on Troubleshooting

Sometimes after setting up a printer, you find that nothing prints. Or, you may get a little farther in the process: something prints, but it is not what you expect--the output is incorrect or illegible. Then, when you get past these problems, other problems may occur, such as:
  • LP commands hanging
  • Printers becoming idle
  • Users getting conflicting messages

Note - Although many of the suggestions in this chapter are relevant to parallel printers, they are geared toward the more common serial printers.

Troubleshooting No Output (Nothing Prints)

When nothing prints, there are three general areas to check:
  • The printer hardware
  • The network
  • The LP print service
If you get a banner page, but nothing else, this is a special case of incorrect output. See "Troubleshooting Incorrect Output" on page 1033.

Check the Hardware

The hardware is the first area to check. As obvious as it sounds, you should make sure that the printer is plugged in and turned on. In addition, you should refer to the manufacturer's documentation for information about hardware settings. Some computers use hardware switches that change the characteristics of a printer port.
The printer hardware includes the printer, the cable that connects it to the computer, and the ports into which the cable plugs in at each end. As a general approach, you should work your way from the printer to the computer. Check the printer. Check where the cable connects to the printer. Check the cable. Check where the cable connects to the computer.

Check the Network

Problems are more common with remote print requests--those going from a print client to a print server. You should make sure that network access between the print server and print clients is enabled.
If the network is running the Network Information Service Plus (NIS+), see the NIS+ and FNS Administration Guide in the Solaris 2.5 System Administrator AnswerBook for instructions to enable access between systems. If the network is not running the Network Information Service (NIS) or NIS+, before you set up print servers and print clients, include the Internet address and system name for each client system in the /etc/hosts file on the print server. Also, the Internet address and system name for the print server must be included in the /etc/hosts file of each print client system.

Check the LP Print Service

For printing to work, the LP scheduler must be running on both the print server and print client. If it is not running, you need to start it using the /usr/lib/lp/lpsched command. If you have trouble starting the scheduler, see "How to Restart the Print Scheduler" on page 936.
In addition to the scheduler running, a printer must be enabled and accepting requests before it will produce any output. If the LP print service is not accepting requests for a printer, the submitted print requests are rejected.
Usually, in that instance, the user receives a warning message after submitting a print request. If the LP print service is not enabled for a printer, print requests remain queued on the system until the printer is enabled.
In general, you should analyze a printing problem as follows:
  • Follow the path of the print request step-by-step.
  • Examine the status of the LP print service at each step.

    · Is the configuration correct?

    · Is the printer accepting requests?

    · Is the printer enabled to process requests?

  • If the request is hanging on transmission, examine the lpNet log (/var/lp/logs/lpNet).
  • If the request is hanging locally, examine the lpsched log (/var/lp/logs/lpsched).
  • If the request is hanging locally, have notification of the printer device errors (faults) mailed to you, and re-enable the printer.
The procedures found in "Troubleshooting Printing Problems" on page 1037 use this strategy to help you troubleshoot various problems with the LP print service.
If basic troubleshooting of the LP print service does not solve the problem, you need to follow the troubleshooting steps for the specific client/server case that applies:
  • SunOS 5.x print client using a SunOS 5.x print server (for instructions, see page 1044)
  • SunOS 5.x print client using a SunOS 4.1 print server (for instructions, see page 1049)
  • SunOS 4.1 print client using a SunOS 5.x print server (for instructions, see page 1054)

Troubleshooting Incorrect Output

If the printer and the print service software are not configured correctly, the printer may print, but it may provide output that is not what you expect.

Check the Printer Type and File Content Type

If you used the wrong printer type when you set up the printer with the LP print service, inappropriate printer control characters can be sent to the printer. The results are unpredictable: nothing may print, the output may be illegible, or the output may be printed in the wrong character set or font.
If you specified an incorrect file content type on a SunOS 5.x print client or a SunOS 5.x print server, the banner page may print, but that is all. The file content types specified for a printer indicate the types of files the printer can print directly, without filtering. When a user sends a file to the printer, the file is sent directly to the printer without any attempt to filter it. The problem occurs if the printer cannot handle the file content type.
When setting up print clients, you increase the chance for a mistake because the file content types must be correct on both the print server and the print client. If you set up the print client as recommended with any as the file content type, files are sent directly to the print server and the print server determines the need for filtering. Therefore, the file content types have to be specified correctly only on the server.
You can specify a file content on the print client to off-load filtering from the server to the client, but the content type must be supported on the print server.

Check the stty Settings

Many formatting problems can result when the default stty (standard terminal) settings do not match the settings required by the printer. The following sections describe what happens when some of the settings are incorrect.
Wrong Baud Settings When the baud setting of the computer does not match the baud setting of the printer, usually you get some output, but it does not look like the file you submitted for printing. Random characters are displayed, with an unusual mixture of special characters and undesirable spacing. The default for the LP print service is 9600 baud.

Note - If a printer is connected by a parallel port, the baud setting is irrelevant.

Wrong Parity Setting Some printers use a parity bit to ensure that data received for printing has not been garbled during transmission. The parity bit setting for the computer and the printer must match. If they do not match, some characters either will not be printed at all, or will be replaced by other characters. In this case, the output looks approximately correct; the word spacing is all right and many letters are in their correct place. The LP print service does not set the parity bit by default.
Wrong Tab Settings If the file contains tabs, but the printer expects no tabs, the printed output may contain the complete contents of the file, but the text may be jammed against the right margin. Also, if the tab settings for the printer are incorrect, the text may not have a left margin, it may run together, it may be concentrated to a portion of the page, or it may be incorrectly double-spaced. The default is for tabs to be set every eight spaces.
Wrong Return Setting If the output is double-spaced, but it should be single-spaced, either the tab settings for the printer are incorrect or the printer is adding a line feed after each return. The LP print service adds a return before each line feed, so the combination causes two line feeds.
If the print zigzags down the page, the stty option onlcr that sends a return before every line feed is not set. The stty=onlcr option is set by default, but you may have cleared it while trying to solve other printing problems.

Troubleshooting Hung LP Print Service Commands

If you type any of the lp commands (such as lpsystem, lpadmin, or lpstat) and nothing happens (no error message, status information, or prompt is displayed), chances are something is wrong with the LP scheduler. Such a problem can usually be resolved by stopping and restarting the LP scheduler. See "How to Stop the Print Scheduler" on page 936 and "How to Restart the Print Scheduler" on page 936 for instructions.

Troubleshooting Idle (Hung) Printers

You may find a printer that is idle, even though it has print requests queued to it. A printer may seem idle when it should not be for one of the following reasons:
  • The current print request is being filtered.
  • The printer has a fault.
  • Networking problems may be interrupting the printing process.

Check the Print Filters

Slow print filters run in the background to avoid tying up the printer. A print request that requires filtering will not print until it has been filtered.

Check Printer Faults

When the LP print service detects a fault, printing resumes automatically, but not immediately. The LP print service waits about five minutes before trying again, and continues trying until a request is printed successfully. You can force a retry immediately by enabling the printer.

Check Network Problems

When printing files over a network, you may encounter the following types of problems:
  • Requests sent to print servers may back up in the client system (local) queue.
  • Requests sent to print servers may back up in the print server (remote) queue.
Print Requests Backed Up in the Local Queue Print requests submitted to a print server may back up in the client system queue for the following reasons:
  • The print server is down.
  • The printer is disabled on the print server.
  • The network between the print client and print server is down.
  • Underlying SunOS 5.x network software was not set up properly.
While you are tracking down the source of the problem, you should stop new requests from being added to the queue.
Print Requests Backed Up in the Remote Queue If print requests back up in the print server queue, the printer has probably been disabled. When a printer is accepting requests, but not processing them, the requests are queued to print. Unless there is a further problem, once the printer is enabled, the print requests in the queue should print.

Troubleshooting Conflicting Status Messages

A user may enter a print request and be notified that the client system has accepted it, then receive mail from the print server that the print request has been rejected. These conflicting messages may occur for the following reasons:
  • The print client may be accepting requests, while the print server is rejecting requests.
  • The definition of the printer on the print client might not match the definition of that printer on the print server. More specifically, the definitions of the print job components, like filters, character sets, print wheels, or forms are not the same on the client and server systems.
You should check that identical definitions of these job components are registered on both the print clients and print servers so that local users can access printers on the print servers.

Troubleshooting Printing Problems

This section contains step-by-step instructions that explain:
  • How to troubleshoot no output
  • How to troubleshoot incorrect output
  • How to unhang the LP commands
  • How to troubleshoot an idle (hung) printer
  • How to resolve conflicting status messages

· How to Troubleshoot No Output

This task includes the following troubleshooting procedures to try when you submit a print request to a printer and nothing prints:
  • Check the hardware (page 1037).
  • Check the network (page 1039).
  • Check the LP print service basic functions (page 1040).
  • Check printing from a SunOS 5.x print client to a SunOS 5.x print server (page 1044).
  • Check printing from a SunOS 5.x print client to a SunOS 4.1 print server (page 1049).
  • Check printing from a SunOS 4.1 print client to a SunOS 5.x print server (page 1054).
Try the first three procedures in the order in which they are listed, before going to the specific print client/server case that applies. However, if the banner page prints, but nothing else does, turn to the instructions under "How to Troubleshoot Incorrect Output" on page 1060.
To check the hardware: 1. Check that the printer is plugged in and turned on.
  1. Check that the cable is connected to the port on the printer and to the port on the system or server.

  1. Make sure that the cable is the correct cable and that it is not defective.

    Refer to the manufacturer's documentation. If the printer is connected to a serial port, verify that the cable supports hardware flow control; a NULL modem adapter supports this. Table 52-1 shows the pin configuration for NULL modem cables.

Table 52-1
HostPrinter
Mini-Din-825-Pin D-sub25-Pin D-sub
-1 (FG)1(FG)
3(TD)2(TD)3(RD)
5(RD)3(RD)2(TD)
6(RTS)4(RTS)5(CTS)
2(CTS)5(CTS)4(RTS)
4(SG)7(SG)7(SG)
7(DCD)6(DSR), 8(DCD)20(DTR)
1(DTR)20(DTR)6(DSR), 8(DCD)
  1. Check that any hardware switches for the ports are set properly.

    See the printer documentation for the correct settings.

  2. Check that the printer is operational.

    Use the printer's self-test feature, if the printer has one. Check the printer documentation for information about printer self-testing.

  3. Check that the baud settings for the computer and the printer are correct.

    If the baud settings are not the same for both the computer and the printer, sometimes nothing will print, but more often you get incorrect output. For instructions, see "How to Troubleshoot Incorrect Output" on page 1060.

To check the network: 1. On a print client, type ping print-server and press Return. On the print server, type ping print-client and press Return.
The ping command helps you check that the network link between the print server and the print client is set up correctly.

  # ping neptune  
  neptune is alive  
  # ping jupiter  
  jupiter not available  

If the message says the system is alive, you know you can reach the system, so the network is all right. The message also tells you that either a name service or the local /etc/hosts file has translated the host (system) name you entered into an IP address; otherwise, you would need to enter the IP address.
If you get a not available message, try to answer the following questions: How is NIS or NIS+ set up at your site? Do you need to take additional steps so that print servers and print clients can communicate with one another? If your site is not running NIS or NIS+, have you entered the IP address for the print server in each print client's /etc/hosts file, and entered all print client IP addresses in the /etc/hosts file of the print server?
  1. Check that the port monitor is configured correctly on the print server.

    See "Setting Up a Printer With the LP Print Service Commands" on page 923.

  2. Check that the network listen services are registered with the port monitor on the print server.

    See "Setting Up a Printer With the LP Print Service Commands" on page 923.

To check the basic functions of the LP print service: 1. On both the print server and print client, make sure that the LP print service is running.
a. Type lpstat -r and press Return. This command shows whether the LP scheduler is running.

  # lpstat -r  
  scheduler is running  

b. If the scheduler is not running, become root or lp, type
/usr/lib/lp/lpsched, and press Return. If you have trouble starting the scheduler, see "How to Unhang the LP Commands" on page 1065.
  1. On both the print server and print client, make sure that the printer is accepting requests.

    a. Type lpstat -a and press Return. This command verifies that the LP system is accepting requests for each printer configured for the system.


  # lpstat -a  
  red accepting requests since Wed Mar 13 20:37:07 PST 1995  
  luna not accepting requests since Wed Apr 17 19:10:55 PDT 1995  
  unknown reason  

b. If the printer is not accepting requests, become root or lp, type accept printer-name and press Return. The specified printer now accepts requests.
  1. On both the print server and print client, make sure that the printer is enabled to print submitted print requests.

    a. Type lpstat -p printer-name and press Return. This command displays information about printer status. You can omit the printer name to obtain information about all printers set up for the system. The following example shows a printer that is disabled.


  # lpstat -p luna  
  printer luna disabled since Wed Apr 17 19:13:33 PDT 1995.  
  available.  
  unknown reason  

b. If the printer is disabled, become root or lp, type
enable printer-name and press Return.

  # enable luna  
  printer "luna" now enabled.  

The specified printer is enabled to process print requests.
  1. On the print server, make sure that the printer is connected to the correct serial port.

    a. Type lpstat -t and press Return. This command tells you the port to which the printer is connected. In the following example, the printer is connected to /dev/term/a.


  # lpstat -t  
  scheduler is running  
  system default destination: luna  
  device for luna: /dev/term/a  

The message device for printer-name shows the port address. Is the cable connected to the port to which the LP print service says is connected? If the port is correct, skip to Step 5.
b. Become root or lp.
c. Type chown lp device-filename and press Return. This command assigns the special user lp as the owner of the device file. In this command, device-filename is the name of the name of the device file.
d. Type chmod 600 device-filename and press Return. This command allows only root or lp to access the printer port device file.
  1. On both the print server and print client, make sure that the printer is configured properly.

    a. Type lpstat -p printer-name -l and press Return. The following example shows a PostScript printer that is configured properly, and that is available to process print requests. If the printer type and file content type are correct, skip to Step 6.


  # lpstat -p luna -l  
  printer luna is idle. enabled since Wed Feb  4  
  20:17:21 PST 1970. available.  
          Content types: postscript  
          Printer types: PS  

b. If the printer type or file content type is incorrect, type
lpadmin -p printer-name -T printer-type -I file-content-type and press Return.
On the print client, try setting the print type to unknown and the content type to any.
  1. On the print server, make sure that the printer is not waiting because of a printer fault.

    a. Type lpadmin -p printer-name -F continue and press Return. This command instructs the LP print service to continue if it is waiting because of a fault.

    b. Type enable printer-name and press Return. This command forces an immediate retry.

c. (Optional) Type lpadmin -p printer-name -A 'write root' and press Return.
This command instructs the LP print service to set a default policy of writing root--sending the printer fault message to the terminal on which root is logged in--if the printer fails. This may help you get quick notification of faults as you try to fix the problem.
  1. Make sure that the printer is not set up incorrectly as a login terminal.


Note - It is easy to mistakenly set up a printer as a login terminal, so be sure to check this possibility even if you think it does not apply.

a. Type ps -ef and press Return. In the output from this command, look for the printer port entry. In the following example, port /dev/term/a is set up incorrectly as a login terminal. You can tell by the "passwd\n## information at the end of the line. If the port is set correctly, skip the last steps in this procedure.

  # ps -ef  
   root   169   167  0   Apr 04 ?        0:08 /usr/lib/saf/listen tcp  
      root   939     1  0 19:30:47 ?        0:02 /usr/lib/lpsched  
      root   944   939  0 19:30:47 ?        0:00 lpNet  
      root   859   858  0 19:18:54 term/a   0:01 /bin/sh -c /etc/lp/interfaces/luna \  
  luna-294 rocket!smith "passwd\n##  
  #  

b. Type cancel request-id and press Return. In this command, request-id is the request ID number for a print request to be canceled.

  # cancel luna-294  

The print request is canceled.
c. Type lpadmin -p printer-name -h and press Return. This command sets the printer port to be a nonlogin device. d. Type ps -ef and press Return.
Check the output from this command to verify that the printer port is no longer a login device.
If you do not find the source of the printing problem in the basic LP print service functions, continue to one of the following procedures for the specific client/server case that applies.
To check printing from a SunOS 5.x client to a SunOS 5.x print server: 1. Check the basic functions of the LP print service on the print server, if you have not done so already.
For instructions on checking basic functions, see page 1040. Make sure that the printer works locally before trying to figure out why nothing prints when a request is made from a print client.
  1. Check the basic functions of the LP print service on the print client, if you have not done so already.

    For instructions on checking basic functions, see page 1040. On the print client, the LP scheduler has to be running, and the printer has to be enabled and accepting requests before any request from the client will print.


Note - For most of the following steps, you must be logged in as root or lp.

  1. Make sure that the print server is accessible.

    a. On the print client, type ping print-server and press Return. This command sends an "are you there?" request to the system you specify.


  # ping neptune  
  neptune is alive  
  # ping jupiter  
  jupiter not available  

If you receive the message system not available, you have a network problem.
  1. On the print client, make sure that the print server is identified as type

    s5.

    a. Type lpsystem -l and press Return. The following example shows a print server, neptune, that is properly identified as type s5 (SunOS 5.x).


  # lpsystem -l  
  System:                     neptune  
  Type:                       s5  
  Connection timeout:         never  
  Retry failed connections:   after 10 minutes  
  Comment:                    none  
  #  

b. If the print server is incorrectly identified, type
lpsystem -t S5 print-server and press Return.

  # lpsystem -t S5 neptune  

  1. On the print client, check the print queue.

    a. Type cd /var/spool/lp/requests/print-client and press Return. A record of print requests still in the queue is kept in this directory. For more information about the content of the request logs, see "Log Files" on page 893.

    b. Type ls -l and press Return.

    A list of the print requests in the queue is displayed.

c. For the print request you want to check, type lpstat -o request-id and press Return.
The following example shows a print request that is queued successfully.

  # cd /var/spool/lp/requests/neptune  
  # ls -l  
  total 12  
  -rw-rw----   1 lp       lp            43 May 22 19:44 11-0  
  # lpstat -o luna-11  
  luna-11             root               364   May 22 19:59  
  #  

If the print request is not queued successfully, the client/server connection may be faulty.
  1. Make sure that the client/server connection is not faulty.

    a. On the print client, type tail /var/lp/logs/lpNet and press Return.

    This command shows you if lpNet can connect to the print server. The following example shows the log for a print request that could not connect to the print server.


  # tail /var/lp/logs/lpNet  
  05/21/95 19:36 p  1780 <none> Starting.  
  05/21/95 19:36 p  1780 <none> Starting lpNetParent.  
  05/21/95 19:36 p  1780 <none> Initialized & Polling.  
  05/21/95 19:36 c  1781 neptune Starting.  
  05/21/95 19:36 p  1780 <none> Started child for neptune, pid =  
  1781  
  ***05/21/95 19:36 c  1781 neptune Could not connect to remote  
  child.  
  05/21/95 19:36 c  1781 neptune Normal process termination.  
  #  

b. If the connection is not being made, type
lpstat -t on the print server and press Return. This command shows you whether the print server is operating properly. A connection cannot be made otherwise.
The following example shows a print server up and running.

  # lpstat -t  
  scheduler is running  
  system default destination: luna  
  device for luna: /dev/term/a  
  luna accepting requests since Thu May 23 20:56:26 PDT 1995  
  printer red is idle. enabled since Sun May 19 17:12:24 PDT 1995.  
  available.  
  printer luna now printing luna-314. enabled since Fri May 24  
  16:10:39 PDT 1995. available.  
  luna-129            root               488   May 23 20:43 filtered  
  #  

c. If the print server is not operating properly, go back to Step 1, otherwise go on to Step 6d.
d. On the print server, type tail /var/lp/logs/lpNet and press Return.
Examine the lpNet log to see if the print server is connecting to the client. If there is no entry, lpNet is not transmitting correctly. The following example shows the log for a print request that connected to the print server.

  # tail /var/lp/logs/lpNet  
  08/10/95 15:17 p   708 <none> Normal process termination.  
  08/10/95 15:17 p  3802 <none> Starting.  
  08/10/95 15:17 p  3802 <none> Starting lpNetParent.  
  08/10/95 15:17 p  3802 <none> Initialized & Polling.  
  08/10/95 15:17 p  3802 <none> Started child for saturn, pid =  
  3804  
  08/10/95 15:17 c  3804 saturn lpd starting (active)  
  08/10/95 15:17 c  3804 saturn lpd connected to saturn  
  08/10/95 15:17 c  3804 saturn lpd disconnecting from saturn  
  08/10/95 15:17 c  3804 saturn lpd connected to saturn  
  08/10/95 15:17 c  3804 saturn lpd disconnecting from saturn  

  1. On the print server, make sure that the print client is correctly specified as an s5 system.

    a. Type lpsystem -l and press Return. The following example shows a print client, neptune, that is configured correctly.


  # lpsystem -l  
  System:                     neptune  
  Type:                       s5  
  Connection timeout:         never  
  Retry failed connections:   after 10 minutes  
  Comment:                    none  

b. If the print client configuration is incorrect, type
lpsystem -t s5 print-client and press Return.

  # lpsystem -t s5 neptune  

  1. On the print server, make sure that the port monitor and network listen services are set up properly.

    a. Type sacadm -l and press Return. The following example shows a print server configured correctly.


  # sacadm -l  
  PMTAG          PMTYPE         FLGS RCNT STATUS     COMMAND  
  tcp            listen         -    9999 ENABLED    /usr/lib/saf/listen tcp #  
  #  

b. Type pmadm -l and press Return.
The following example shows a print server configured for all three types of services.

  # pmadm -l  
  PMTAG          PMTYPE         SVCTAG         FLGS ID       <PMSPECIFIC>  
  tcp            listen         lp             -    root     - - p - /var/spool/lp/fifos/listenS5 #  
  tcp            listen         lpd            -    root     \x000202038195143a0000000000000000  
  - p - /var/spool/lp/fifos/listenBSD #  
  tcp            listen         0              -    root     \x00020ACE8195143a0000000000000000  
  - c - /usr/lib/saf/nlps_server #  

If either Step 8a or Step 8b shows a problem, see "Setting Up a Printer With the LP Print Service Commands" on page 923 for information on setting up the port monitor and network listen services.
To check printing from a SunOS 5.x client to a SunOS 4.1 print server: 1. Check the basic functions of the LP print service on the print client, if you have not done so already.
For instructions, see page 1040.
  1. Make sure that the print server is accessible.

    a. On the print client, type ping print-server and press Return. An "are you there?" request is sent to the system you specify.


  # ping neptune  
  neptune is alive  
  # ping jupiter  
  jupiter not available  

If you receive the message system not available, you have a network problem.
  1. Make sure that the lpd daemon on the print server is running.

    a. On the print server, type ps -ax | grep lpd and press Return. If the lpd daemon is running, a line is displayed, as shown in the following example. If it is not running, no process information is shown.


  $ ps -ax | grep lpd  
    126 ?  IW    0:00 /usr/lib/lpd  
    200 p1 S     0:00 grep lpd  
  $  

b. If lpd is not running on the print server, become root on the print server, type /usr/lib/lpd & and press Return.
  1. Make sure that the remote lpd daemon is configured properly.

    a. On the print server, become root, and type /usr/etc/lpc and press Return.

    The lpc> prompt is displayed.

    b. Type status and press Return.

    Status information is displayed. In the following example, the daemon is not running and needs to be restarted.


  # /usr/etc/lpc  
  lpc> status  
  red:  
  queuing is enabled  
  printing is enabled  
  no entries  
  no daemon present  
  lpc>  

c. If no daemon is present, at the lpc> prompt, type restart and press Return.
The daemon is restarted.
d. Type status and press Return.
Check the information displayed to verify that the lpd daemon has started.
e. Type quit and press Return. The shell prompt is redisplayed.
  1. Make sure that the print client has access to the print server.

    a. Check if there is an /etc/hosts.lpd file on the 4.1 print server. On a 4.1 print server, if this file exists, it is used to determine whether an incoming print request can be accepted. If the file does not exist, all print client systems have access, so skip steps b and c.

    b. If the file exists, see if the print client is listed in the file.

    Requests from client systems not listed in the file are not transferred to the print server.

    c. If the client is not listed, add the print client to the file.


Note - If you get this far without pinpointing the problem, the SunOS 4.1 system is probably set up and working properly.

  1. Make sure that the connection to the remote lpd print daemon from the print client is made correctly.

    a. On the print client, become root, and type ps -ef | grep lp and press Return.

    The lpNet and lpsched daemons should be running, as shown in the following example.


  # ps -ef | grep lp  
     root   162   154 51   Jan 07 ?        0:01 lpNet  
     root   154     1 80   Jan 07 ?        0:02 /usr/lib/lpsched  

If the lpNet daemon is running, skip to Step 7.
b. Type lpshut and press Return.
The LP print service is stopped.
c. Type /usr/lib/lp/lpsched and press Return. The LP print service is restarted, including the lpNet daemon.
  1. Make sure that the remote print server is identified correctly as a SunOS 4.1 system.

    a. On the print client, become root, type lpsystem -l and press Return. The following example shows a SunOS 4.1 print server, jupiter, that is specified correctly, as shown by Type being set to bsd.


  # lpsystem -l  
  System:                     jupiter  
  Type:                       bsd  
  Connection timeout:         never  
  Retry failed connections:   after 10 minutes  
  Comment:                    none  

b. If the print server is incorrectly identified, type lpsystem -t bsd print-server and press Return.
  1. Make sure that the print client is not having trouble connecting to the print server.

    a. On the print client, type tail -100 /var/lp/logs/lpNet and press Return.

    By examining the lpNet log, you can tell if the print client (for example, jupiter) is reaching the print server. Normally, the contents will be similar to the following:


  # tail -100 /var/lp/logs/lpNet  
  04/18/95 09:40 p  1097 <none> Starting.  
  04/18/95 09:40 p  1097 <none> Starting lpNetParent.  
  04/18/95 09:40 p  1097 <none> Initialized & Polling.  
  04/17/95 19:32 c   965 jupiter lpd connected to jupiter  
  04/17/95 19:32 c   965 jupiter lpd disconnecting from jupiter  
  #  

If the results appear normal, skip the last steps in this procedure. If there is a problem, you will see retries to the BSD system, as shown in the following example.

  # tail -100 /var/lp/logs/lpNet  
  05/23/95 14:39 c   120 jupiter lpd retrying connection to  
  jupiter  
  05/23/95 14:51 c   120 jupiter lpd retrying connection to  
  jupiter  
  05/23/95 15:02 c   120 jupiter lpd retrying connection to  
  jupiter  
  #  

b. On the print client, type lpsystem -l print-server and press Return. This command shows you the retry and time-out parameters currently set.
c. Type lpsystem -T {n,0,N} -R {n,0,N} print-server and press Return.
The -T option specifies the length of time a network connection can be idle before it is dropped. Choose either n (never time out), 0 (drop immediately), or enter a number (wait N minutes, then drop connection). The default is n. The -R option specifies the length of time to wait before trying to re-establish a connection. Choose either n (don't retry until there is more work), or 0 (try to reconnect immediately), or enter a number (wait N minutes before trying to reconnect). The default is wait 10 minutes before trying to reconnect.

  # lpsystem -T n -R 0 saturn  
  "saturn" has been modified.  

To check printing from a SunOS 4.1 client to a SunOS 5.x print server: 1. Check the basic functions of the LP print service on the print server, if you have not done so already.
For instructions, see page 1040. Make sure that the printer works locally before trying to figure out why nothing prints when a request is made from a print client.

Note - You should be logged in as root or lp on the system specified in the following steps.

  1. Make sure that the print client is accessible.

    a. On the SunOS 5.x print server, become root, then type ping print-client and press Return.


  # ping rocket  
  rocket is alive  

If you receive the message system not available, you have a network problem.
  1. On the print client, become root, then type lpr -P printer-name filename and press Return.

    This command shows whether the print client is working. The following example shows that the print client is not working correctly.


  # lpr -P luna /etc/fstab  
  lpr: cannot access luna  
  #  

  1. Make sure that the lpd daemon is running on the print client.

    a. Type ps -ax | grep lpd and press Return. This command shows if the lpd daemon is running on the print client. The following example shows that the daemon is running.


  # ps -ax | grep lpd  
    118 ?  IW    0:02 /usr/lib/lpd  
  #  

b. On the print client, type /usr/lib/lpd & and press Return.
  1. On the print client, make sure that there is a printcap entry identifying the print server.

    a. Type lpr -P printer-name filename and press Return. The following example shows that the /etc/printcap file does not have an entry for the specified printer.


  # lpr -P mercury /etc/fstab  
  lpr: mercury: unknown printer  
  #  

b. If there is no entry, edit the /etc/printcap file and add the following information:
printer-name|print-server:\
:lp=:rm=print-server:rp=printer-name:br#9600:rw:\
:lf=/var/spool/lpd/printer-name/log:\
:sd=/var/spool/lpd/printer-name:

The following example shows an entry for printer luna connected to print server neptune.

  luna|neptune:\  
          :lp=:rm=neptune:rp=luna:br#9600:rw:\  
          :lf=/var/spool/lpd/luna/log:\  
          :sd=/var/spool/lpd/luna:  

c. Create a spooling directory (/var/spool/lpd/printer-name) for the printer.
  1. Make sure that the print client lpd is not in a wait state by forcing a retry. If the print server is up and responding, the print client lpd may be in a wait state before attempting a retry.

    a. As root on the print client, type lpc and press Return. The lpc> prompt is displayed.

    b. Type restart printer-name and press Return.

    c. Type quit and press Return. The shell prompt is redisplayed.


  # lpc  
  lpc> restart luna  
  luna:  
         no daemon to abort  
  luna:  
        daemon started  
  #quit  
  terra$  

  1. Check the connection to the print server.

    a. On the print client, become root, type

    more /var/spool/lpd/printer-name/log and press Return. Frequently, no information is displayed.

    b. Type more /var/spool/lpd/printer-name/status and press Return.


  # more /var/spool/lpd/luna/status  
  waiting for neptune to come up  
  #  

c. If the connection is all right, on the print serve, type lpstat -t and press Return.
This command shows you if the print server is operating properly. The following example shows a print server that is up and running.

  # lpstat -t  
  scheduler is running  
  system default destination: luna  
  device for luna: /dev/term/a  
  luna accepting requests since Thu May 23 20:56:26 PDT 1995  
  printer uranus is idle. enabled since Sun May 19 17:12:24 PDT  
  1995.  
  available.  
  printer luna now printing luna-314. enabled since Fri May  
  24 16:10:39 PDT 1995. available.  
  luna-129            root               488   May 23 20:43 filtered  
  #  

If the print server is not running, go back to Step 1 before continuing.
d. On the print server, type tail /var/lp/logs/lpNet and press Return.
Examine the messages to see if the connection is being made from the print client to the lpNet process on the print server. The following example shows a print client that is transmitting correctly.

  # tail /var/lp/logs/lpNet  
  # tail /var/lp/logs/lpNet  
  05/24/95 16:26 c  3651 rocket lpd exiting, status=0  
  05/24/95 16:33 c  3727 rocket lpd starting (passive)  
  05/24/95 16:33 c  3727 rocket rocket requests recvjob luna  
  05/24/95 16:33 c  3727 rocket lpd exiting, status=0  
  05/24/95 16:43 c  3835 rocket lpd starting (passive)  
  05/24/95 16:43 c  3835 rocket rocket requests recvjob luna  
  05/24/95 16:43 c  3835 rocket lpd exiting, status=0  
  #  

If there is no entry, lpNet is not transmitting correctly. If the connection is being made, it implies that the problem is on the print client, and you should check the basic functions of the LP print service on the print client before continuing.
  1. On the print server, make sure that the print client is a BSD system.

    a. Type lpsystem -l and press Return. The following example shows a print client, rocket, that is configured correctly.


  # lpsystem -l  
  System:                     rocket  
  Type:                       bsd  
  Connection timeout:         never  
  Retry failed connections:   after 10 minutes  
  Comment:                    none  
  #  

b. If the print client is not specified correctly, type lpsystem -t bsd print-client and press Return.
  1. On the print server, make sure that the port monitor and network listen services are set up properly.

    a. Type sacadm -l and press Return. The following example shows a print server that is configured correctly.


  # sacadm -l  
  PMTAG          PMTYPE         FLGS RCNT STATUS     COMMAND  
  tcp            listen         -    9999 ENABLED    /usr/lib/saf/listen tcp #  
  #  

b. Type pmadm -l and press Return.
The following example shows a server that is configured for all three services.

  # pmadm -l  
  PMTAG          PMTYPE         SVCTAG         FLGS ID       <PMSPECIFIC>  
  tcp            listen         lp             -    root     - - p - /var/spool/lp/fifos/listenS5 #  
  tcp            listen         lpd            -    root     \x000202038195143a0000000000000000  
  - p - /var/spool/lp/fifos/listenBSD #  
  tcp            listen         0              -    root     \x00020ACE8195143a0000000000000000  
  - c - /usr/lib/saf/nlps_server #  

If either Step 9a or Step 9b shows a problem, see "Setting Up a Printer With the LP Print Service Commands" on page 923 for instructions on how to set up the port monitor and network listen services.

· How to Troubleshoot Incorrect Output

  1. Log in as root or lp.

  2. Make sure that the printer type is correct.

    An incorrect printer type may cause incorrect output. For example, if you specify printer type PS and the pages print in reverse order, try printer type PSR. (These type names must be in uppercase.) Also, an incorrect printer type may cause missing text, illegible text, or text with the wrong font. To determine the printer type, examine the entries in the terminfo database. For information on the structure of the terminfo database, see "Printer Type" on page 873.

    a. On the print server and print client, type lpstat -p printer-name -l and press Return.

    This command lists the characteristics of the printer.


  mars$ lpstat -p luna -l  
  printer luna is idle. enabled since Wed Jan  2 18:20:22 PST 1995. available.  
          Content types: simple,postscript  
          Printer types: PS  
          Description:  
          Users allowed:  
                  (all)  
          Forms allowed:  
                  (none)  
          Banner not required  
          Character sets:  
                  (none)  
          Default pitch:  
          Default page size:  
  mars$  

b. Consult the printer manufacturer's documentation to determine the printer model.
c. If the printer type is not correct, change it with Admintool's Modify Printer option, or type lpadmin -p printer-name -T printer-type and press Return.
On the print client, the printer type should be unknown. On the print server, the printer type must match a terminfo entry that is defined to support the model of printer you have. If there is no terminfo entry for the type of printer you have, see "How to Add a terminfo Entry for an Unsupported Printer" on page 1005.
  1. If the banner page prints, but there is no output for the body of the document, check the file content types.

    File content types specified for a printer indicate the types of files the printer can print directly without filtering. An incorrect file content type causes filtering to be bypassed when it may be needed.

    a. Note the information on file content type that was supplied in the previous step by the lpstat command.

    On the print client, the file content type should be any, unless you have good reason to specify one or more explicit content types. If a content is specified on the client, filtering is done on the print client, rather than the print server. In addition, content types on the client must match the content types specified on the print server, which in turn must reflect the capabilities of the printer.

    b. Consult your printer manufacturer's documentation to determine which types of files the printer can print directly.

    The names you use to refer to these types of files do not have to match the names used by the manufacturer. However, the names you use must agree with the names used by the filters known to the LP print service.

    c. If the file content type is not correct, change it with Admintool's Modify Printer option, or type

    lpadmin -p printer-name -I file-content-type(s) and press Return. Run this command on either the print client, or print server, or both, as needed. Try -I any on the print client, and -I "" on the print server. The latter specifies a null file content type list, which means an attempt should be made to filter all files, because the printer can directly print only files that exactly match its printer type.

    This combination is a good first choice when files are not printing. If it works, you may want to try specifying explicit content types on the print server to reduce unnecessary filtering. For a local PostScript printer, you

should use postscript, or postscript,simple-- if the printer supports these types. Be aware that PS and PSR are not file content types; they are printer types.
If you omit -I, the file content list defaults to simple. If you use the -I option and want to specify file content types in addition to simple, simple must be included in the list.
When specifying multiple file content types, separate the names with commas. Or you can separate names with spaces and enclose the list in quotation marks. If you specify any as the file content type, no filtering will be done and only file types that can be printed directly by the printer should be sent to it.
  1. Check that the print request does not bypass filtering needed to download fonts.

    If a user submits a print request to a PostScript printer with the command lp -T PS, no filtering is done. Try submitting the request with the command lp -T postscript to force filtering, which may result in the downloading of non-resident fonts needed by the document.

  2. Make sure that the stty settings for the printer port are correct.

    a. Read the printer documentation to determine the correct stty settings for the printer port.


Note - If a printer is connected by a parallel port, the baud setting is irrelevant.

b. To examine the current settings, type stty -a < device-name and press Return.
This command shows the current stty settings for the printer port.

  mars# stty -a < /dev/term/a  
  speed 9600 baud;  
  rows = 0; columns = 0; ypixels = 0; xpixels = 0;  
  eucw 1:0:0:0, scrw 1:0:0:0  
  intr = ^c; quit = ^|; erase = ^?; kill = ^u;  
  eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;  
  start = ^q; stop = ^s; susp = ^z; dsusp = ^y;  
  rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;  
  parenb -parodd cs7 -cstopb -hupcl cread -clocal -loblk -parext  
  -ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl  
  -iuclc  
  ixon -ixany -ixoff imaxbel  
  isig icanon -xcase echo echoe echok -echonl -noflsh  
  -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten  
  opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3  
  mars#  

Table 52-2 shows the default stty options used by the LP print service's standard printer interface program.
Table 52-2 stty
OptionMeaning
9600Set baud rate to 9600
cs8Set 8-bit bytes
-cstopbSend one stop bit per byte
-parityDo not generate parity
ixonEnable XON/XOFF (also known as START/STOP or DC1/DC3)
opostDo "output post-processing" using all the settings that follow in this table
-olcucDo not map lowercase to uppercase
onlcrChange line feed to carriage return/line feed
-ocrnlDo not change carriage returns into line feeds
-onocrOutput carriage returns even at column 0
Table 52-2 stty(Continued)
OptionMeaning
n10No delay after line feeds
cr0No delay after carriage returns
tab0No delay after tabs
bs0No delay after backspaces
vt0No delay after vertical tabs
ff0No delay after form feeds
c. To change the stty settings, type lpadmin -p printer-name -o "stty=options" and press Return. Use Table 52-3 to choose stty options to correct various problems affecting print output.
Table 52-3 stty

stty Values

Result
Possible Problem
From Incorrect Setting
110, 300, 600,
1200, 1800,
2400, 4800,
9600, 19200,
38400
Sets baud rate to the
specified value (enter
only one baud rate)
Random characters and special
characters may be printed and spacing
may be inconsistent
oddp
evenp
-parity
Sets odd parity
Sets even parity
Sets no parity
Missing or incorrect characters appear
randomly
-tabsSets no tabsText is jammed against right margin
tabsSets tabs every eight
spaces
Text has no left margin, is run together,
or is jammed together
-onlcrSets no carriage return at the beginning of line(s)Incorrect double spacing
onlcrSets carriage return at beginning of line(s)The print zigzags down the page
You can change more than one option setting by enclosing the list of options in single quotation marks and separating each option with spaces. For example, suppose the printer requires you to enable odd
parity and set a 7-bit character size. You would type a command similar to that shown in the following example:

  #lpadmin -p neptune -o "stty='parenb parodd cs7'"  

The stty option parenb enables parity checking/generation, parodd sets odd parity generation, and cs7 sets the character size to 7 bits.
  1. Type lp -d printer-name filename and press Return. Verify that the document prints correctly.

· How to Unhang the LP Commands

  1. Log in as root or lp.

  2. Type lpshut and press Return.

    If this command hangs, press Control-c and proceed to the next step. If this command succeeds, skip to step 4.

  3. Type ps -el | grep lp and press Return.


  # ps -el | grep lp  
     103 ?        0:00 lpNet  
     134 term/a   0:01 lpsched#  

Use the process ID numbers (PIDs) from the first column in place of the pid variables in the next step.
  1. Type kill -15 pid1 pid2... and press Return.

    This should stop the LP print service processes. If the processes do not stop, as a last resort go to step 5.


  # kill -15 103 134  

  1. Type kill -9 pid1 pid2... and press Return.

    All the lp processes are terminated.

  1. Type rm /usr/spool/lp/SCHEDLOCK and press Return. This command removes the SCHEDLOCK file so you can restart the LP print service.

  2. Type /usr/lib/lp/lpsched and press Return. The LP print service should restart. If you are having trouble restarting the scheduler, see "How to Restart the Print Scheduler" on page 936.

· How to Troubleshoot an Idle (Hung) Printer

This task includes a number of procedures to use when a printer appears idle but it should not be. It makes sense to try the procedures in order, but the order is not mandatory.
To check that the printer is ready to print: 1. Type lpstat -p printer-name and press Return. The information displayed shows you whether the printer is idle or active, enabled or disabled, or available or not accepting print requests. If everything looks all right, continue with other procedures in this section. If you cannot run the lpstat command, see "How to Unhang the LP Commands" on page 1065.
  1. If the printer is not available (not accepting requests), type

    accept printer-name and press Return. The printer begins to accept requests into its print queue.

  2. If the printer is disabled, type enable printer-name and press Return. This command re-enables the printer so that it will act on the requests in its queue.

To check for print filtering: Type lpstat -o printer-name and press Return.
See if the first waiting request is being filtered. If the output looks like the following example, the file is being filtered; the printer is not hung, it just is taking a while to process the request.

  terra$ lpstat -o luna  
  luna-10           fred         1261   Mar 12 17:34 being filtered  
  luna-11           iggy         1261   Mar 12 17:36 on terra  
  luna-12           jack         1261   Mar 12 17:39 on terra  
  terra$  

To resume printing after a printer fault: 1. Look for a message about a printer fault and try to correct the fault if there is one.
Depending on how printer fault alerts have been specified, messages may be sent to root by email or written to a terminal on which root is logged in.
  1. Type enable printer-name and press Return. If a request was blocked by a printer fault, this command will force a retry. If this command does not work, continue with other procedures in this section.

To send print requests to a remote printer when they back up in the local queue:
  1. On the print client, type reject printer-name and press Return. This command stops further queuing of print requests from the print client to the print server.

  2. Type ping print-server and press Return.

    The information displayed indicates whether the print server and the network between the print client and the print server are up.

  3. Type more /var/lp/logs/lpNet and press Return. The information displayed may help you pinpoint what is preventing the transmission of print requests from the print client to the print server.

  1. After you fix the problem, type accept printer-name on the print client and press Return.

    This command allows new print requests to be queued.

  2. If necessary, type enable printer-name on the print client and press Return.

    This command enables the printer you specify.

To free print requests from a print client that back up in the print server queue:
  1. On the print server, type reject printer-name and press Return. This command stops further queuing of print requests from any print client to the print server.

  2. Type more /var/lp/logs/lpsched and press Return. The information displayed may help you pinpoint what is preventing the print requests from the print client to the print server from being printed.

  3. After you fix the problem, type accept printer-name on the print server and press Return.

    This allows new print requests to be queued.

  4. If necessary, type enable printer-name on the print server and press Return.

· How to Resolve Conflicting Status Messages

  1. Type lpstat -p printer-name and press Return. Check that the printer connected to the print server is enabled and is accepting requests. Users will see conflicting status messages when the print client is accepting requests, but the print server is rejecting requests.

  2. On the print server, type lpstat -p -l printer-name and press Return. This command checks that the definition of the printer on the print client matches the definition of the printer on the print server. Look at the definitions of the print job components, like print filters, character sets, print wheels, and forms, to be sure they are the same on both the client and server systems so that local users can access printers on print server systems.