lprsrv.8


NAME

lprsrv - a PPR component which accepts Berkeley lpr jobs, generally with the aid of inetd.


SYNOPSIS

lprsrv [--help] [--version] [--hostname] [--fully-qualify] [-s port] [-p] [-A seconds] [-S list]


DESCRIPTION

lprsrv is a Berkeley lpr/lpd compatible print server. It will accept print jobs and invoke ppr to handle them. If the requested printer is not defined in PPR, lprsrv will hand them to the computer's native spooling system which is generally lp or lpr).

Access Control

Unless invoked with the -p (permissive) switch, lprsrv will only accept connections from hosts allowed by /etc/hosts.lpd, F/etc/hosts.equiv.

Each line in an authorization file must be either the fully qualified name of a host (That is, as returned by gethostbyaddr() would return it) or the name of a domain. If it is a domain, it must begin with a period. A domain name is considered to match all hosts in that domain.

For example, if the file /etc/hosts.lpd contains:

# This is /etc/hosts.lpd .cs.trincoll.edu mouse.xc.trincoll.edu

and /etc/hosts.lpd_deny contains:

# This is /etc/hosts.lpd_deny fiend.cs.trincoll.edu

then the computers ``starbase.cs.trincoll.edu'' and ``mouse.xc.trincoll.edu'' can connect but ``fiend.cs.trincoll.edu'' cannot.

If the -p switch is used, any client can connect and clients not listed in /etc/hosts.lpd or /etc/hosts.equiv need not connect from a reserved port.

If you don't know the fully qualified form of the name of a host you wish to put in one of the authorization files, the --fully-qualify option may be used to determine it:

$ /usr/ppr/lib/lprsrv --fully-qualify=shakti shakti.cc.trincoll.edu

Setup With Inetd

To use lprsrv throuh inetd, make sure a line like this is in /etc/services:

printer 515/tcp spooler

Then put a line like this in /etc/inetd.conf:

printer stream tcp nowait ppr /usr/ppr/lib/lprsrv lprsrv

Or, if you want to run it in `permissive' mode:

printer stream tcp nowait ppr /usr/ppr/lib/lprsrv lprsrv -p

If you wish to use lprsrv and lpd together, you must either run lprsrv on a port other than 515, or you must arrange for inetd to be started before lpd. If inetd is started before lpd, lpd will be unable to bind to port 515 but will still work otherwise and lprsrv will pass remote jobs to lpr.

Setup for Standalone Mode

If lprsrv is run with the -s switch it will run in standalone mode. The argument of the -s switch is the name or number of the TCP/IP port on which it should listen for requests. For example, you might put this command in /etc/rc.local:

/usr/ppr/lib/lprsrv -s printer

Queue Listing Options

When a client requests a queue listing for a PPR queue, lprsrv will return the output of ppop lpq for the short format and ppop list for the long format. The ppop lpq output is designed to look similiar to the output of BSD lpq.

If the -A switch is used, lprsrv will pass the switch and its argument on to ppop. The argument is an integer which indicates an age in seconds. Arrested jobs older than the specified age will not be shown in queue listings.

When a client requests a queue listing for an LPR/LPD queue, lprsrv simply executes lpq and returns the output.

When a client requests a queue listing for a System V lp queue, lprsrv runs lpstat. Some lpq options are not supported for lp queues.

Removing Jobs

Job access control is fully implemented for PPR queues. An ordinary user may only cancel jobs which he submitted. He must send the cancel request from the machine the job origionated at. The user ``root'' on any machine may cancel any job submitted from that machine.

The user ``root'' on certain machines may cancel any job from any machine. The list of machines on which root has this privledge is specified with the -S switch. The argument is a colon separated list. The machine names used in this list should be fully qualified. The lprsrv --fully-qualify switch may be used to determine the fully qualified form of a name:

$ /usr/ppr/lib/lprsrv --fully-qualify cberry.trincoll.edu cberry.cc.trincoll.edu

If no -S switch is used, lprsrv will attempt make a default list containing only the fully qualified form of the name of the host it is running on. This process requires several DNS queries, so you may wish to do it once and add an -S switch to the lprsrv command line. The --hostname switch will determine the fully qualified name of the node it is running on and print the result:

$ /usr/ppr/lib/lprsrv --hostname mouse.xc.trincoll.edu

This name may then be added to the lprsrv command line in /etc/inetd.conf:

printer stream tcp nowait ppr /usr/ppr/lib/lprsrv lprsrv -S mouse.xc.trincoll.edu

Access control for lpr and lp queues is much more primative. Any user may cancel any job submitted through lprsrv.

Support for DEC Extensions

The version of lpr supplied with DEC OSF/1 has many more options than the BSD version. Using these extra options results in extra lines in the queue file which lpr sends to lprsrv. These extensions are supported by lprsrv whenever possible.


FILES

The directory /tmp is used for temporary files. This program reads the files /etc/hosts.lpd /etc/hosts.lpd_deny, and /etc/hosts.equiv.

This program may invoke ppr(1), ppop(1), lp(1), cancel(1), lpstat(1), lpr(1), lpq(1), and lprm(1).


SEE ALSO

ppr(1), lp(1), lpr(1), ppop(1), lpstat(1), lpq(1), cancel(1), lprm(1). ``PPR, a PostScript Print Spooler'', ``Installing and Using PPR'', inetd.conf(5), and inetd(8).


HISTORY

PPR was written at Trinity College during 1993, 1994, 1995, and 1996.


AUTHORS

David Chappell, Trinity College Computing Center, Hartford, Connecticut.