 |
» |
|
|
 |
This section describes common LP spooler tasks. Initializing the LP Spooler |  |
Before you can use the LP spooler, you need to initialize
it as follows: (Note: If you use SAM to add a printer, SAM will do the above
steps.) Specifying the Printer Model File
to the LP Spooler |  |
When you configure your printer into the LP spooler, you must
identify the printer interface script to be used. There are printer
interface scripts you can choose from in the /usr/lib/lp/model
directory. This directory contains files corresponding to the models
and names of all HP printers and plotters (plus some generic model
files). Table 10-1 “Model Files and Corresponding Printers
and Plotters ” lists the names
of the basic model files, the additional models to which they are
linked, and the HP product numbers they support. The /usr/sbin/lpadmin
command will copy the identified model script to /etc/lp/interface/printername.
See lpadmin(1M) for information on the command
options. If you are configuring a non-HP printer to HP-UX, read the
ASCII model files to identify the essential printer characteristics
— such as whether your printer uses Printer Command Language
(PCL) or PostScript. Also see the manual that came with your printer
for more information on PCL language levels. For third-party printers
that are not PostScript printers, use the model dumb;
for non-PostScript plotters, use dumbplot. Table 10-1 Model Files and Corresponding Printers
and Plotters model
File | Intended Purpose |
|---|
HPGL1 | LP interface for HP7440A HP7475A plotter;
identical files: colorpro,
hp7440a, hp7475a | HPGL2 | LP interface for HP7550A, HP7596A, HP7570A
plotter; identical files: hp7550a,
hp7570a, hp7595a,
hp7596a, draftpro | HPGL2.cent | LP interface for HP7550Plus, HP7550B
plotters, and 7600 Series Electrostatic plotters when connected
via parallel interface | PCL1 | PCL level 1 model interface; identical
files: hp2225a,
hp2225d, hp2227a,
hp2228a, hp2631g,
hp3630a, paintjet,
quietjet, thinkjet | PCL2 | PCL level 2 model interface; identical
files: hp2300-1100L,
hp2300-840L,
hp2560, hp2563a,
hp2564b, hp2565a,
hp2566b, hp2567b | PCL3 | PCL level 3 model interface; identical
files: deskjet,
deskjet500, deskjet500C,
deskjet550C,
hp2235a, hp2276a,
hp2932a, hp2934a,
ruggedwriter | PCL4 | PCL level 4 model interface; identical
files: hp33447a,
laserjet, hp5000f100 | hp33440a | model file based on PCL level 4; identical
files: hp2684a,
hp2686a | PCL5 | PCL level 5 model interface, identical
files: hp5000c30,
laserjet4Si,
laserjetIIISi,
laserjet4 | deskjet1200C | LP interface based on PCL5; including
support for language switching; identical file: deskjet1200C
(this is the same file name as the model file), paintjetXL300 | hpC1208a | LP interface for HP C1208A, based on
PCL5 | dumb | LP interface for dumb line printer | dumbplot | LP interface for dumb plotter | hp256x.cent | LP interface for the HP 256x
family of line printers | postscript | LP interface for PostScript printer,
for use on HP LaserJet IID, III, printers with HP 33439P LaserJet
PostScript cartridge, as well as generic PostScript printers. Supports
only RS-232-C, parallel interfaces. | rmodel | LP interface for remote printers. |
Overview of Printer Types |  |
A local printer is physically connected
to your system. A remote printer is physically
connected to another system. To access the remote printer, your
system sends requests through the local area network (LAN) to the
other system. To configure a remote printer into your local LP spooler,
you must be able to access the remote system via the LAN. A network-based printer differs from
a remote printer. See “Adding a Network-Based Printer”
later in this chapter for more information. Adding a Local Printer to the LP
Spooler |  |
Adding a printer to the LP spooler differs from adding a printer
to your system: adding a printer to the LP spooler involves configuring
the LP spooler, whereas adding a printer to your system involves
connecting the printer to your computer and configuring the needed
drivers in the kernel. For information on the latter, refer to Configuring
HP-UX for Peripherals. The easiest way to add a local printer to the LP spooler is
to run SAM. SAM will also do some of the HP VUE configuration (if
HP VUE is being used) and some of the SharedPrint configuration
(if you are using a SharedPrint printer model). If you decide to use HP-UX commands instead, follow these
steps: Ensure that you have superuser capabilities. Stop the LP spooler: For more information, see “Stopping and Restarting the LP
Spooler ” later in this chapter. Add the printer to the LP spooler. For example: lpadmin -pchk_printer -v/dev/lp -mhp2934a -g7 |
See lpadmin(1M) for details on the
options. Allow print requests to be accepted for the newly
added printer. For example: See “Controlling the Flow of Print Requests” later
in this chapter for information on accept. Enable the newly added printer to process print
requests. For example: See “Enabling or Disabling a Printer” later
in this chapter for details. Restart the LP spooler:
Adding a Remote Printer to the LP
Spooler |  |
The easiest way to add a printer to a remote system is to
run SAM. If you decide to use HP-UX commands instead, follow the
above steps in “Adding a Local Printer to the LP
Spooler ”,
except replace Step 3 with the following: If the remote printer is on an HP-UX
system, enter: lpadmin -plocal_printer -v /dev/null -mrmodel \ |
> -ormremote_machine -orpremote_dest -ocmrcmodel -osmrsmodel |
If the remote printer is not
on an HP-UX system, enter: lpadmin -plocal_printer -v /dev/null -mrmodel \ |
> -ormremote_machine -orpremote_dest -ocmrcmodel -osmrsmodel -ob3 |
See
lpadmin(1M) for details on the options. If your remote printer does not work, check if the remote
printing daemon (rlpdaemon)
is correctly running on the remote machine (that is, the host on
which the physical printer resides): Examine the file /etc/inetd.conf
and look for the following line: # printer stream tcp nowait root /usr/sbin/rlpdaemon rlpdaemon -i |
If there is a #
sign at the beginning of the line, the rlpdaemon
line is commented out, preventing the printer from printing remotely. Edit the file /etc/inetd.conf
to remove the #
sign. Save the file. Check /etc/services
and look for: #printer 515/tcp spooler #remote print spooling |
If there is a #
sign at the beginning of the line, it is commented out. Edit the
file to remove the #
sign in the first column and save the file. Reconfigure the Internet daemon inetd,
forcing it to reread the /etc/inetd.conf
file:
Also, check entries in /var/adm/inetd.sec
that restrict which systems can send remote print requests. Adding a Network-Based Printer |  |
A network-based printer is connected directly to the LAN,
thus is not physically connected to any system.
Network printers do not use device special files. You can use SAM to add a network-based printer that uses the
HP JetDirect Network Interface. The HP JetDirect software must be
installed on your system and you must be prepared to provide SAM
with the printer's node name (the name associated with an Internet
address) and the local name that the LP spooler will use to refer
to the printer. With HP JetDirect, printers can connect directly
to the network. The printer uses a LAN connection and the HP JetDirect
software transmits prints requests. For more information, see HP
JetDirect Network Interface Configuration Guide. If you do not use SAM, follow the instructions shipped with
your printer or the network interface card for the printer. Creating a Printer Class |  |
You can make efficient use of multiple printers by creating
a printer class. A printer class is a name
you use to refer to a group of printers. Print requests can then
be spooled to a single print queue and print requests will be printed
by the first available printer in the class. Thus, logjams on a
particular printer are reduced or avoided. (Note that remote printers
cannot belong to a printer class.) You can use SAM to add a printer to a printer class when the
printer is being added to the spooler; otherwise, you must use HP-UX
commands. To use HP-UX commands, follow these steps after several
printers have been added to the LP spooler: Ensure that you have superuser capabilities. Stop the LP spooler: For more information, see “Stopping and Restarting the LP
Spooler ” later in this chapter. Create the printer class, specifying the printer
you want to add to the class of printers. For example, to add a
printer named laser1
to the class of printers named laser,
enter: Only one printer can be added to a class at a time. If you
have more than one printer to add, repeat this command. The lpadmin
command can add a printer to a new class, add a printer to an existing
class, or move a printer from one class to another class (a printer
can only belong to one class). Allow print requests to be accepted for the newly
added printer class. For example: Restart the LP spooler:
Removing a Printer from the LP Spooler |  |
You can use SAM or HP-UX commands to remove a printer from
the LP spooler. If you use SAM, SAM asks for confirmation before
removing the printer. If there are print jobs in the printer's queue,
or if the printer is the system default destination, SAM's confirmation
message will include that information. If you choose to remove a
printer that has jobs in its queue, SAM cancels those jobs. If you use HP-UX commands, follow these steps: Ensure that you have superuser capabilities. (Optional): Notify users that you are removing the
printer from the system. Remove the printer from the configuration file of
any software application through which the device is accessed. (Refer
to the documentation accompanying the software application for instructions.) Stop the LP spooler: For more information, see “Stopping and Restarting the LP
Spooler ” later in this chapter. (Optional): Deny any further print requests for
the printer. For example: reject -r"Use alternate printer." laser1 |
By doing this step, you can be assured that no new jobs will
appear before you remove the printer. Users will see the message "Use alternate printer"
when they direct requests to a rejected destination if the printer
has not yet been removed. Once the printer has been removed and
a user tries to send a request, they will see the message "Destination
printer_name non-existent".
See “Controlling the Flow of Print Requests” later in this
chapter for information on reject. (Optional): Determine if there are any jobs in the
printer's queue. For example: (Optional): Disable the printer to be removed. For
example: disable -r"Printer laser1 is disabled." laser1 |
You would issue the above disable
command if there are jobs in the printer's queue and you do not
want to wait for them to print before removing the printer. Issuing
the disable command
shuts the printer down in an orderly manner. For more information, see “Enabling or Disabling a Printer” later in this chapter. Note that you can also specify
the -c option
to the disable
command to cancel all print requests for the printer. (Optional): If there are no jobs in the printer's
queue, go on to Step 9. If there are jobs, decide whether to move
all pending print requests in the request directory to another printer
request directory or to cancel any requests. For example, to move
print requests: To cancel any requests: Remove the printer from the LP spooler. For example: Restart the LP spooler:
See lpshut(1M), lpadmin(1M),
and lpsched(1M) for details on the command
options. Removing a Printer from a Printer
Class |  |
SAM does not provide a way to you to remove a printer from
a class. Instead, use HP-UX commands as follows: Ensure that you have superuser capabilities. Stop the LP spooler: For more information, see “Stopping and Restarting the LP
Spooler ” later in this chapter. Remove the printer from the class. For example: Restart the LP spooler:
See lpshut(1M), lpadmin(1M),
and lpsched(1M) for details on the command
options. Removing a Printer Class |  |
SAM does not provide a way to you to remove a printer class.
Instead, use HP-UX commands as follows: Ensure that you have superuser capabilities. Stop the LP spooler: For more information, see “Stopping and Restarting the LP
Spooler ” next in this chapter. (Optional): Deny any further print requests for
the printer. For example: reject -r"Use alternate printer." laser1 |
(Optional): Determine if there are any jobs in the
printer's queue. For example: (Optional): Move all pending print requests in the
request directory for the printer class to another printer or printer
class. For example: Remove the printer class. For example: Restart the LP spooler:
See lpshut(1M), reject(1M),
lpmove(1M), lpadmin(1M),
and lpsched(1M) for details on the command
options. When you remove a printer class, the printers in the class
are not removed — you can still use them as individual
printers. If you remove all printers from a class, that printer
class is automatically removed. Stopping and Restarting the LP
Spooler |  |
Typically, the LP spooler is started during the boot process.
(To change the boot-up procedure by not starting the scheduler,
edit the file /etc/rc.config.d/lp
and set the shell environment variable LP
to zero.) The spooler must be stopped whenever the spooling system needs
to be modified (such as when adding or removing a printer) and subsequently
restarted after the modification has been made. You can use either
SAM or HP-UX commands to stop or start the LP spooler. If you use HP-UX commands to stop the LP spooler, follow these
steps: Ensure that you have superuser capabilities. Check if there are any requests printing or being
sent to a remote printer (it is best to wait until there are no
requests printing before stopping the LP spooler). In the above command, the -i
option inhibits the reporting of remote requests (that is, lpstat
will only show local requests). Stop the LP spooler: All requests printing when lpshut
is executed will be stopped, but will remain in the print queues. Restart the LP spooler:
When the spooler is restarted, the requests in the print queue
will be completely reprinted regardless of how much of the request
was printed prior to the shutdown. See lpshut(1M)
and lpsched(1M) for details.
|