lpc
Hurricane Electric Internet Services
NAME
lpc - line printer control program
SYNOPSIS
lpc [ -Pprinter ] [ -Ddebugopts ] [ -V ] [ command [ argu-
ment ... ] ]
DESCRIPTION
Lpc is used by the system administrator to control the
operation of the line printer system. For each line
printer configured in /etc/printcap or the printcaps spec-
ified in the configuration file lpd.conf (see
lpd.conf(5)), lpc may be used to:
o disable or enable a single or all printer,
o disable or enable a single printer's or all printer's
spooling queue,
o rearrange the order of jobs in a spooling queue (moving
jobs to the top or to the end of a queue or changing
their priority in the queue),
o find the status of printers, and their associated
spooling queues and printer dameons,
o start and stop printer servers for a queue with multi-
ple print servers,
o hold and release a specific job in a printer queue,
o redirect printing to another printer
o restart a printer job after having solved printer prob-
lems and let it print from the beginning,
Without any arguments, lpc will prompt for commands from
the standard input. If arguments are supplied, lpc inter-
prets the first argument as a command and the remaining
arguments as parameters to the command. Permission to use
spool queue control commands is determined by the printer
permissions file (See FILES).
OPERATION
The operation of each spool queue is controlled by a
spoolcontrol file which has a set of keyword options and
values. (Other print spoolers have used permissions bits
of directories and files for similar purposes). In addi-
tion, each job in the spool queue can have a holdfile
which contains detailed information on how the spooler is
to treat the particular job. The server will update these
files with status and other information as the job is pro-
cessed. The lpc command operates by sending requests to
the lpd server process to update the information in these
files and to signal server processes that the information
has been updated.
OPTIONS
-Pprinter
Printer spool queue to operate on. if no name is
given, the -P option, the printer selected by the
value of the PRINTER enviroment variable, or the
first entry in the printcap file will be used. When
all printers are selected, the LPC command will first
attempt to find the printcap entry for printer
``all''; the all printcap field value will be a list
of printers to control. If there is no printcap
entry, then the request is directly forwarded to the
default LPD host, which will do a lookup for all of
the available printers. By specifying ``all@host'',
the user can control all printers on a given host.
-V Print program version information
-Ddebugopts
Debugging is controlled using the -D option. This
accepts a comma-separated list of debugging settings.
These settings take one of two forms: facility=value
, or value to set an overall default value. The form
-D= will display a list of debugging options.
COMMANDS
The following is the alphabetical list of recognized com-
mands. The jobcontrol or holdfile fields effective are
listed as part of the command.
?
Help. Also, any unrecognized input produces a help
listing.
abort { all | printer* }
Kill the active job and disables unspooling. The
active job will not be deleted from the queue.
Action: kills server process, updates spool control
file printing_disabled field.
holdall { all | printer* }
Turn on automatic job holding. Jobs will be held
until released with the hold command, or holdall
turned off with the noholdall command. The :ah:
printcap flag can enable automatic holding as well.
Action: updates spool control file holdall field.
debug { all | printer } [string | off ]
Set the debugging string for the specified printer.
This is a diagnostic aid and should be used with
caution; refer to the reference manual for details
of the debugging string format. In general, you
can use: INTEGER [,key=integer] [log=pathname].
The INTEGER is a general debugging level, key is
the name of a special debugging flag, and log is
the pathname of a log file.
Action: updates spool control file debug field.
disable { all | printer }
Disable spooling to the specified spool queues.
See enable.
Action: updates spool control file printing_dis-
abled field.
class {all | printer } (off | classlist | X=globmatch)
Controls the class of jobs currently being printed.
The off option removes any class restrictions. The
classlist option is a list of classes; for example
A,B,C would release classes A, B, and C for print-
ing. The X=globmatch form performs a match against
a control file entry starting with the indicated
capital letter. For example, J=*form1* would
allow jobs which had the string form1 in their job
title to be printed.
down {all | printer }
Disable both queuing and printing for all printers
or the selected printer. See up.
Action: updates spool control file printing_dis-
abled and spooling_disabled fields.
enable { all | printer }
Enable spooling for all printers or the selected
printer.
Action: updates spool control file spooling_dis-
abled field.
exit or quit
terminate LPC program
help
Print a short help message.
hold printer { jobid }
Holds the specified printer job (or jobs) in the
queue. The job will not be printed even if spool-
ing and printing is enabled. It must be released
with the relase command. The holdall command or
:ah: printcap flag can enable automatic holding of
spooled jobs.
Action: updates job holdfile hold field with time
that job was held. A 0 value release job for
printing.
kill { all | printer ... }
Do an abort command followed by a start command.
This is a quick way to kill off a server that has
problems. Note that due to race conditions and
delays, that the start command may not be effective
this action should be monitored to ensure that the
job restarts.
lpd
determines the LPD daemon process is running, This
is handy to determine if the LPD daemon was killed
or aborted due to abnormal conditions.
lpq printer [options]
Run lpq from inside the lpc program.
lprm printer [options]
Run lprm from inside the lpc program.
move printer { jobid } destinationPrinter
Send the specified jobs to the destination printer
and remove them from the printer queue.
Action: updates the job holdfile move field with
the destination and starts a server process to do
the job transfer.
noholdall { all | printer* }
Turn off automatic job holding. See holdall com-
mand.
quit or exit
terminate LPC program
redirect [printer [destinationPrinter | off ]]
redirect the jobs in the printer queue to another
printer or turn redirection off.
Action: updates spool control file redirect field.
release [printer [jobid]]
Releases the selected job for printing.
reread [ printer ]
Sends a request to the LPD server for the printer
to reread the configuration and printcap informa-
tion. This is equivalent to using kill -HUP
serverpid, but can be done for servers on remote
hosts.
start { all | printer }
Start the printer. This is useful when some abnor-
mal condition causes the server to terminate unex-
pectedly leaving jobs in the queue. Lpq will
report that there is no daemon present when this
condition occurs.
status { all | printer }
Display the status of daemons and queues on the
local machine.
stop { all | printer }
Disable any further unspooling after the current
job completes.
topq printer [ jobid ]
Place the selected jobs at the top of the printer
queue.
up {all | printer ...}
Enables queuing and printing for the specified or
all printers. Privileged.
JOBIDS
The LPQ command displays a job identifier for each job,
which can be used in LPC commands to identify a specific
job. In the commands descriptions above, the jobid can be
a user name, a job number, a job identifier, or a glob
pattern. The glob pattern is matched against the job
identifier. In command which have an optional jobid, if
none is specified then the first printable job in the
queue is acted on.
FILES
The files used by LPRng are set by values in the printer
configuration file. The following are a commonly used set
of default values.
/etc/lpd.conf LPRng configuration file
/etc/printcap printer description file
/etc/lpd.perms printer permissions
/var/spool/printer* spool directories
/var/spool/printer*/printer lock file for queue control
/var/spool/printer*/control.printer queue control
/var/spool/printer*/active.printer active job
/var/spool/printer*/log.printer log file
SEE ALSO
lpd.conf(5), lpc(8), lpd(8), lpr(1), lpq(1), lprm(1),
printcap(5), lpd.perms(5), pr(1).
DIAGNOSTICS
Most of the diagnostics are self explanatory.
If you are puzzled over the exact cause of failure,
set the debugging level on (-D5) and run again.
The debugging information will
help you to pinpoint the exact cause of failure.
HISTORY
LPRng is a enhanced printer spooler system, with function-
ality similar to the Berkeley LPR software, and is derived
from the PLP (Public Line Printer) software, version 4.0.
LPRng has many advanced features, which are described in
LPRng - An Enhanced Line Printer Spooler by Patrick Pow-
ell, San Diego State University (papowell@sdsu.edu), et
al. It is available from dickory.sdsu.edu:/pub/LPRng.
The LPRng software is based on PLP4.0, supported and
extended by Justin Mason (jmason@iona.ie), which is avail-
able from ftp://ftp.iona.ie/pub/PLP4.0. Justin greatly
aided in the design and development of many of the soft-
ware features, as well as contributing a large number of
bug fixes, design reviews, and other suggestions.
Hurricane Electric Internet Services
Copyright (C) 1998
Hurricane Electric.
All Rights Reserved.