Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lpadmin(1M) — HP-UX 9.05

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

enable(1)

lp(1)

lpstat(1)

nroff(1)

accept(1M)

lpana(1M)

lpsched(1M)

mklp(1M)

mknod(1M)

rcancel(1M)

rlp(1M)

rlpdaemon(1M)

rlpstat(1M)

lpadmin(1M)

NAME

lpadmin − configure the LP spooling system

SYNOPSIS

/usr/lib/lpadmin −pprinter [options]
/usr/lib/lpadmin −xdest
/usr/lib/lpadmin −d[dest]

DESCRIPTION

lpadmin configures LP spooling systems to describe printers, classes and devices.  It is used to add and remove destinations, change membership in classes, change devices for printers, change printer interface programs, and to change the system default destination.  lpadmin cannot be used when the LP scheduler, lpsched(1M), is running, except where noted below.

Exactly one of the −p, −x or −d options must be present for every legal invocation of lpadmin.

−pprinter Names a printer to which all of the options below refer.  If printer does not exist, it will be created. 

−xdest Removes destination dest from the LP system.  If dest is a printer and is the only member of a class, the class is deleted, too.  No other options are allowed with −x. 

−d[dest] Makes existing destination dest the new system default destination.  If dest is not supplied, there is no system default destination.  This option can be used when lpsched(1M) is running. No other options are allowed with −d. 

The following options are only useful with −p and can appear in any order.  For ease of discussion, the printer is referred to below as printer P.

−acluster_client Indicates that the printer P is attached to the specified cluster client. If omitted in a clustered environment, it assumes that printer P is attached to the cluster server. 

−cclass Inserts printer P into the specified class. class is created if it does not already exist. 

−eprinter Copies an existing printer’s interface program to be the new interface program for printer P.

−gpriority Sets the default priority for printer P associated with lp(1). If omitted, the default priority is set to 0.

−h Indicates that the device associated with printer P is hardwired.  This option is assumed when creating a new printer unless the −l option is specified. 

−iinterface Establishes a new interface program for printer P. interface is the pathname of the new program. 

−l Indicates that the device associated with printer P is a login terminal.  The LP scheduler (see lpsched(1M)) disables all login terminals automatically each time it is started. Before re-enabling printer P, its current device should be established using lpadmin.

−mmodel Selects a model interface program for printer P. model is one of the model interface names supplied with the LP software (see Models below). 

−rclass Removes printer P from the specified class. If printer P is the last member of the class, the class is removed. 

−vdevice Associates a new device with printer P. device is the pathname of a file that is writable by the LP administrator lp. Note that there is nothing to stop an administrator from associating the same device with more than one printer. If only the −p and −v options are supplied, lpadmin can be used while the scheduler is running.  If the −a option is supplied, device should be the pathname of a device file that is on the cluster client. 

The following options are only useful with −p and can appear in any order.  They are provided with systems that provide remote spooling. 

−ob3 Uses three-digit request numbers associated with the printer directory.  This is for contact with BSD systems.  The default is to not use three-digit request numbers. 

−ociremcancel Specifies that the local command remcancel is used to cancel requests to remote printers.  To ensure that the correct command is used, specify the full path name. 

−ocmremcancel Specifies that the local model remcancel is used to cancel requests to remote printers. 

−ormmachine The name of the remote machine is machine.

−orpprinter The name of the printer to use on the remote machine is printer.

−orc Restricts users to canceling only their own requests.  Default is to not restrict the cancel command. 

−osiremstatus Specifies that the command remstatus is used to obtain the status of requests to remote printers.  To ensure that the correct command is used, specify the full path name. 

−osmremstatus Specifies that the  model remstatus is used to obtain the status of requests to remote printers. 

Restrictions

When creating a new printer, the −v option and one of the −e, −i , or −m options must be specified.  Only one of the −e, −i or −m options can be specified.  The −h and −l key letters are mutually exclusive.  The −a and −l key letters are mutually exclusive.  Printer and class names must not exceed 14 characters and must consist entirely of the characters A-Z, a-z, 0-9 and _ (underscore). 

Models

Model interface programs are supplied with the LP software.  They are shell procedures, C programs, or other executable programs that interface between lpsched(1M) and devices. All printer models reside in directory /usr/spool/lp/model and can be used without modification with lpadmin −m.  All cancel models reside in directory /usr/spool/lp/cmodel and can be used without modification with lpadmin −ocm.  All status models reside in directory /usr/spool/lp/smodel and can be used without modification with lpadmin −osm.  Models should have 644 permission if owned by lp and bin, or 664 permission if owned by bin and bin.  Model file names must not exceed 14 characters.  Alternatively, LP administrators can modify copies of models then use lpadmin −m to associate them with printers.  See mklp(1M) for details of the printer models provided with your HP-UX system. 

The LP model interface program does the actual printing on the device that is currently associated with the printer.  The LP spooler sets standard input to /dev/null and standard output and standard error output to the device specified in the −v option of lpadmin. The interface program is then invoked for printer P from the directory /usr/spool/lp as follows:

interface/P id user title copies options file ...

where arguments are as follows:

id request id returned by lp(1).

user login name of the user who made the request. 

title optional title specified with the −t option of lp(1).

copies number of copies to be printed. 

options blank-separated list of class-dependent or printer-dependent options specified with the −o option of lp(1). Options from a BSD system have the character sequence BSD attached to the beginning of the option (for example, BSDl). 

file full pathname of the file to be printed. 

Given the command line arguments and the output directed to the device, interface programs can format their output in any way they choose. 

When printing is completed, it is the responsibility of the interface program to exit with a code indicative of the success of the print job.  Only return values of 0 indicating that the job completed successfully, or values of positive 1 through 127 indicating that some error was encountered that does not affect future print jobs should be used.  Negative values and positive values greater than 127 are reserved for system use and should not be used by interface programs.  lpsched(1M) notifies users by mail when there is an error in printing the request. If problems are detected that are likely to affect future print jobs, the interface program should disable the printer so that other pending print requests are not lost.

The cancel and status model interface programs perform the actual communication with the remote system to cancel requests or get the status of requests.  See rcancel(1M) and rlpstat(1M) for command line arguments.

HP Clustered Environment

In the HP Clustered Environment, all spooling is handled as if the cluster nodes were a single system and all printers attached to either the cluster server or clients can be available.  Remote spooling applies to spooling from or to machines outside of the cluster nodes. 

EXTERNAL INFLUENCES

Environment Variables

LANG determines the language in which messages are displayed. 

If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. 

If any internationalization variable contains an invalid setting, lpadmin behaves as if all internationalization variables are set to "C" (see environ(5)).

EXAMPLES

Assuming an existing Hewlett-Packard HP2934A line printer named lp1, it will use the hp2934a model interface through /dev/lp after the command:

/usr/lib/lpadmin −plp1 −mhp2934a −v/dev/lp

Assuming an existing Hewlett-Packard HP33440A laser printer locally attached to the cluster client cluster1, it will use the hp33440a model interface through /dev/laser which resides on cluster1 after the command:

/usr/lib/lpadmin −plp2 −mhp33440a −v/dev/laser −acluster1

Assuming a printer lp on a remote system system2, the command:

/usr/lib/lpadmin −plp3 −v/dev/null −mrmodel −ocmrcmodel −osmrsmodel −ob3 −ormsystem2 −orplp −v/dev/null

causes the spool system to use the local line printer lp3 and the model rmodel.  The spool system also uses the model rcmodel to cancel remote requests and rsmodel to get status from system2.  In addition, the three-digit sequence numbers, the remote system name system2 and the remote printer lp are used. 

WARNINGS

When installing remote printers, use the option −ocmrcmodel instead of −oci/usr/lib/rcancel to specify the method used to cancel remote requests.  The option −osmrsmodel should be used instead of −osi/usr/lib/rlpstat to specify the method used for displaying remote status. 

When installing printers attached to cluster clients, lp on the cluster server must be permitted to access the cluster clients using remsh(1) without supplying a passwd. 

When installing printers attached to cluster clients, the device file associated with the printers must be accessed by processes on the cluster clients.  See mknod(1M). 

classes must not include remote printers.  HP-UX systems do not have the ability to distribute print jobs in this way.  Printing to a class of printers on a remote system (systemB for example) must be accomplished by creating the class on the remote system, then identifying that class by using a command resembling:

lpadmin -plocal_name -ormsystemB -orosystemB_class_name

FILES

/usr/spool/lp/∗

SEE ALSO

enable(1), lp(1), lpstat(1), nroff(1), accept(1M), lpana(1M), lpsched(1M), mklp(1M), mknod(1M), rcancel(1M), rlp(1M), rlpdaemon(1M), rlpstat(1M). 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026