Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > L

lpadmin(1M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

lpadmin — configure the LP spooling system

SYNOPSIS

/usr/sbin/lpadmin -pprinter [options]

/usr/sbin/lpadmin -xdest

/usr/sbin/lpadmin -d[dest]

/usr/sbin/lpadmin -s[enable|disable]

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.

Exactly one of the -p, -x, -s, 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. No other options are allowed with -d.

-s[enable|disable]

See the Enabling and Disabling Email Notification section below for more information on this option.

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.

-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. 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.

-orc

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

-ob3

Uses three-digit request numbers associated with the printer directory. Use this option while configuring remote printer queues to BSD systems.

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

-ormmachine

The name of the remote machine is machine.

-orpprinter

The name of the printer or printer class to use on the remote machine is printer.

-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.

-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. Printer and class names must not exceed 250 characters and must consist entirely of the characters A-Z, a-z, 0-9 and _ (underscore). The character set limitation is not applicable for the printer name passed as an argument to the -orp option. It is recommended that printer and class names consist of a maximum of 14 characters to ensure compatibility with other products that work with the LP spooling system.

For a remote printer, only one of -oci or -ocm can be specified. If neither of them is specified, the default remote cancel model /usr/lib/lp/cmodel/rcmodel is used. Similarly, only one of -osi or -osm can be specified. If neither of them is specified, the default remote status model /usr/lib/lp/smodel/rsmodel is used.

All local printers use four-digit request numbers. All remote printers use three-digit request numbers for contact with BSD systems.

Enabling and Disabling Email Notification

Email notification is enabled by default. To modify or query the email notification status, use lpadmin with the following options:

  • /usr/sbin/lpadmin -s[enable|disable]

Following is a description of each of these options:

-s

Print the email notification status.

-senable

Enable email notification.

-sdisable

Disable email notification. This email notification setting is ignored if the print request is queued using the lp command and the -w or -m option. See lp(1).

Models

Model interface programs are supplied with the LP software. They are shell procedures, C programs, or other executable programs that interface between lpsched and devices. All printer models reside in directory /usr/lib/lp/model and can be used without modification with lpadmin -m. All cancel models reside in directory /usr/lib/lp/cmodel and can be used without modification with lpadmin -ocm. All status models reside in directory /usr/lib/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.

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 /etc/lp as follows:

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

where arguments are as follows:

id

request id returned by lp.

user

login name of the user who made the request.

title

optional title specified with the -t option of lp.

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. 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 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 return a error value. This will make lpsched 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.

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 laserjet printer named lp1, it will use the laserjet model interface through /dev/lp after the command:

/usr/sbin/lpadmin -plp1 -mlaserjet -v/dev/lp

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

  • /usr/sbin/lpadmin -plp3 -v/dev/null -mrmodel -ocmrcmodel -osmrsmodel -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 remote system name system2 and the remote printer lp are used.

The following command performs the same operation as above.

  • /usr/sbin/lpadmin -plp3 -v/dev/null -mrmodel -ormsystem2 -orplp

Here the default remote cancel model rcmodel and the default remote status model rsmodel are used.

WARNINGS

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

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 the following (although you might have to change some of the specific values shown in the example):

  • lpadmin -plocal_name -ormsystemB -orpsystemB_class_name -v /dev/null -mrmodel -ocmrcmodel -osmrsmodel

FILES

/var/spool/lp/* /var/adm/lp/* /etc/lp/* /usr/lib/lp/*

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.