Current Projects » PAPI Client Commands
en

PAPI Client Commands

Delivered in Solaris Nevada build 44

What are they ?

 Since their beginning, the printing commands have been tied to a specific print system because they have been implemented on top of print system specific protocols and interfaces. This is true of BSD 4.x LPR, SysV LP, LPRng, CUPS, and more. With the recent introduction of the FSG OpenPrinting Open Standard Print (PAPI), it is now possible to move these commands on top of a print service/protocol neutral interface. Currently, the PAPI include enough functionality to support replacement of the following commands:

Command
Origin
Description
lpr(1b)
BSD
Submit print jobs
lpq(1b)
BSD
Query print queues/jobs
lprm(1b)
BSD
Remove print jobs
lpc(1b)
BSD
Control print queues (accept/reject/enable/disable/status/clear/topq)
lp(1)
SysV
Submit print jobs
lpstat(1)
SysV
Query print service (queues/jobs/other)
cancel(1)
SysV
Remove print jobs
lpmove(1m)
SysV
Move jobs between local queues
accept(1m)
SysV
Enable queueing of print jobs on a queue
reject(1m)
SysV
Disable queueing of print jobs on a queue
enable(1m)
SysV
Enable job processing on a queue
disable(1m)
SysV
Disable job processing on a queue

Destination Names

Each of the printing commands listed above takes a printer/queue/destination name as at least one of it's arguments.  These destination names can be specified in one of three forms:

Atomic (simple)
(destination) is resolved by locating a printer-uri-supported key/value pair for the named destination in the printers.conf(4) or printers(4) configuration database. (If no printer-uri-supported key is found for an entry, it's bsdaddr value is converted to printer uri form and used.)
Printer URI
(scheme://endpoint)  is completely resolved and specifies the protocol and communication endpoint to contact for print services.  This form of destination name is useful for accessing print services outside of your system's current management domain.  Since the name includes the protocol to use when contacting the print service, you can select a richer protocol than the RFC1179 protocol.
POSIX
(server:queue[:extensions]) is complete and resolves to an equivalent printer URI form of lpd://server/printers/queue[#extensions]
 This form is being maintained for Solaris backward compatability only.  "Printer URI" form is the preferred replacement.

 Printer URI formats currently supported include the following:

lpsched
lpsched://localhost/printers/queue**
This printer uri scheme can only be used to contact a local LP service to access the queue named in the uri.
lpd
lpd://localhost/printers/queue[#extensions]
This printer uri scheme can be used to contact local or remote print services to addess the named queue on the named host in the uri.  The optional "#extensions" can be specified as "#solaris" to indicate that the server host will process Solaris extensions to rfc-1179 during job submission.
ipp
ipp://server[:port]/printers/queue
http://server:631/printers/queue**
ipp://server[:port]/...
This printer uri scheme can be used to contact local or remote print services to address a particular queue on the named host in the uri.   The "ipp" uri scheme is specified in the Internet Print Protocol specifications and is actually much more free form that listed above.  All Solaris and CUPS based print queues will be accessed using the formats listed above.  Access to print queues on other IPP based print servers requires use of the server supported ipp uri format.  Generally, it will be one of the formats listed above.

Some additional information

  • As a result of layering these changes, the following commands will no longer need to be installed SUID root:

/usr/bin/lp, /usr/bin/lpstat, /usr/bin/cancel, /usr/bin/lpmove,
 /usr/{ucb|bin}/lpr, /usr/{ucb|bin}lpq, /usr/{ucb|bin}/lprm,
 /usr/lib/print/printd.

In the past, they were installed SUID root because they needed some elevated privilege to either open a reserved port,  allocate a sequential job-id number, or maniplate files in /var/spool/print.  Since this functionality has been localized into a small "helper" application (/usr/lib/print/lpd-port), applications using RFC1179 based PAPI support no longer need elevated privilege.  lpd-port contains minimal support for passing RFC1179 protocol requests on a reserved port and allocating sequential job-id numbers.  While it is installed SUID root, it temporarily drops all elevated privilege until the moment that they are needed.  When needed, the privilege is elevated for the required operation and perminently dropped if it is no longer required.  On Solaris, this is done through the use of privileges(5).  On other platforms, this is done using setuid/seteuid/setreuid().

  • If you have a local printer and don't want to share it with anyone on the network, you can now safely disable the printing network listeners

# svcadm disable application/print/ipp-listener \
                             application/print/rfc1179 (lpd-listener)

  • If you have a Solaris 9u6 or later server, or a CUPS server, lpstat will provide you with more information about remote print queues (and jobs), as well as their capabilities when you use IPP to talk to those servers.
  • It is now possible to accept, reject, enable and disable remote print queues with proper authorization when IPP is in use (more on this to follow)
  • It is now possible to remotely move jobs between queues on a print server when IPP is in use.
  • It is now possible to modify your print jobs remotely when IPP is in use. (eg. submit your job held, change the number of copies, turn on duplexing and release it for printing)

Where can I get access to the bits ?

install-papi-commands.sh
A simple shell script to upgrade several printing related packages on your system to include replacement print commands.
remove-papi-commands.sh
A simple shell script to remove upgraded printing packages and replace them with Solaris Nevada build 35 packages.  If you want to
 match your installation, you will need your installation media.
papi-i386.pkgs
papi-sparc.pkgs
A stream format package file containing upgraded printing packages that include replacement print commands laywered on top of the PAPI
nv35-i386.pkgs
nv35-sparc.pkgs
A stream format package file containing Nevada build 35 printing packages without any replacement print command implementations

Where is the Code ?

Currently, the project is housed on SourceForge at http://sf.net/projects/openprinting/ The code contained in the SourceForge project includes a complete implementation of the PAPI with support for interaction with RFC-1179 based print services, as well as IPP based print services. Also included in that code base is and Apache module that implements server side support for IPP on top of the PAPI. The OpenSolaris code base contains PAPI support for local LP interaction. Though much of the work in the SourceForge project is already delivered with Solaris, this project is focusing on delivering the client commands support already in the code base as replacements for the current implementations that are tied directly to either lpsched or the rfc-1179 protocol.

How can I get Involved ?

The OpenPrinting project, currently hosted at SourceForge (http://sf.net/projects/openprinting/), is where implementation work is being done for the PAPI.  If you are interested in support for other print systems, or extending the API, that is probably a good place to start.  Any work to extend the API will at least be prototyped there before rolling it back into the PAPI standard.
 You will also find pre-built RPM and dpkg(.deb) packages for Linux systems that and be installed in /opt/papi on a Linux system.  Since the naming support native to Solaris is emulated on the Linux systems, it's not as complete as what's available on Solaris.  However, it does contain files and NIS support for printing configuration lookup.
 If you run some other OS, you should be able to build the code with little or no effort.  For the most part, the code makes use of POSIX interfaces.  The only significant exception is in the RFC1179 support, were there is code to pass file
 descriptors between processes (child to parent).  The code to do so is ifdef'd with support for SysV, BSD 4.3, and BSD 4.4 (also Linux) methods of doing this.

Tags:
Created by admin on 2009/10/26 12:10
Last modified by admin on 2009/10/26 12:30

XWiki Enterprise 2.7.1.34853 - Documentation