Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lpadmin(1M) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

enable(1)

lp(1)

lpstat(1)

nroff(1)

accept(1M)

lpsched(1M)

mklp(1M)

rcancel(1M)

rlp(1M)

rlpdaemon(1M)

rlpstat(1M)

LPADMIN(1M)  —  HP-UX

NAME

lpadmin − configure the LP spooling system

SYNOPSIS

/usr/lib/lpadmin −p printer [options]
/usr/lib/lpadmin −x dest
/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 may not 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.

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

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

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

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

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

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

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

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

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

−mmodel Selects a model interface program for 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 P is the last member of the class, then the class will be 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, then lpadmin may be used while the scheduler is running. 

The following options are only useful with −p and may 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 not to use three-digit request numbers. 

−ociremcancel Specifies that the local command remcancel is used to cancel requests to remote printers.  To ensure 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 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 supplied.  Only one of the −e, −i or −m options may be supplied.  The −h and −l key letters are mutually exclusive.  Printer and class names may be no longer than 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 the directory /usr/spool/lp/model and can be used without modification with lpadmin −m.  All cancel models reside in the directory /usr/spool/lp/cmodel and can be used without modification with lpadmin −ocm.  All status models reside in the 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.  Alternatively, LP administrators can modify copies of models and 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 ...

id is the request returned by lp.

user is the logname of the user who made the request. 

title is the optional title specified with the −t option of lp.

copies is the number of copies to be printed. 

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

file is the full pathname of the file to be printed. 

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

When the printing is completed, it is the responsibility of the interface program to exit with a code indicative of the success of the print job.  A return value of 0 indicates that the job completed successfully.  Values of 1 to 127 indicate that some error was encountered.  This problem will not affect future print jobs.  Lpsched notifies users by mail that there was an error in printing the request.  When problems are detected which are likely to effect future print jobs, the interface program would be well to disable the printer so that print requests are not lost. 

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

EXAMPLES

Assuming there is an existing Hewlett-Packard 2934A line printer named lp2, it will use the hp2934a model interface after the command:

/usr/lib/lpadmin −plp2 −mhp2934a

Assuming there is a printer lp on a remote system system, the command:

/usr/lib/lpadmin −plp3 −mrmodel −ocmrcmodel  −osmrsmodel −ob3 −ormsystem2 −orplp}

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. 

DEPENDENCIES

Series 300 Diskless
In a clustered environment, all printers are attached to the rootserver and all spooling is handled as if the cluster were a single system. Remote spooling applies to spooling from or to machines outside of the cluster.

FILES

/usr/spool/lp/∗

SEE ALSO

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

INTERNATIONAL SUPPORT

messages. 

Hewlett-Packard Company  —  May 11, 2021

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