This chapter provides an introduction to printing in the Oracle Solaris operating system (OS). Conceptual information about printing services, tools, and protocols is described. Each of the subsequent chapters in this book describe how to use these tools, protocols, and technologies to administer printing services and printers.
Several terms and concepts that are introduced in this chapter are used frequently throughout this book. To fully grasp printing concepts, a basic understanding of these concepts and terms is essential. For a complete listing of all the printing concepts and terms, see Glossary.
This is a list of the information that is in this chapter.
This section describes new and changed printing features in this Oracle Solaris release. For a complete listing of new features and a description of Oracle Solaris releases, see Oracle Solaris 10 9/10 What’s New.
The design of the Open Standard Print API (PAPI) implementation in the Oracle Solaris release makes it no longer necessary for applications, toolkits, and print commands to run with elevated privilege to interact with print services.
As a result, the following print commands are no longer 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
Previously, these commands were installed SUID root because the commands required an elevated privilege for the following purposes:
Opening a reserved port
Allocating a sequential job-id number
Manipulating files in the /var/spool/print directory
This functionality is now localized in a small helper application, /usr/lib/print/lpd-port. As a result, any applications that use the RFC-1179 PAPI support no longer require elevated privilege. The lpd-port helper application contains minimal support for passing RFC-1179 protocol requests on a reserved port and allocating sequential job-id numbers. Although the helper application is installed SUID root, all elevated privileges are dropped until they are required. When necessary, the privilege is elevated for the required operation and then permanently dropped if the elevated privilege is no longer required. In the Oracle Solaris release, this process is accomplished through the use of privileges. On other platforms, the process is accomplished by using the setuid, seteuid, or setreuid functions.
If you have local printers that you do not want to share on the network, you can safely disable the printing network listeners. If you are running the Oracle Solaris release, or a CUPS server, the lpstat command provides you with more information about remote print queues and print jobs, as well as their capabilities when using IPP to communicate with those servers.
When IPP is in use, and with the proper authorization, the following operations can be performed on remote print queues and print jobs:
accept
reject
enable
disable
move job
modify job
Also, you can now move print requests between queues on a print server and modify print requests remotely when IPP is in use.
For more information, see the privileges(5) man page. For step-by-step procedures, see Administering Printers on a Network When Using the Internet Printing Protocol (Task Map).
Solaris 10 5/08: The PPD File Manager, /usr/sbin/ppdmgr, is a utility for administering PostScriptTM Printer Description (PPD) files that are used with the print subsystem. When you add a PPD file to the system by using the ppdmgr utility or the lpadmin command with the -n option, a cache of PPD file information is automatically updated. This cache is used by Solaris Print Manager.
For more information, see Administering PPD Files by Using the PPD File Management Utility (Task Map) and the ppdmgr(1M) man page.
At the core of the print system is a UNIX System V (R4) based spooler. In addition to the spooler are client applications that are used to make requests of and manage the spooler. filters that perform document translation, back end processing software that performs final document transformation , and device (printer) communication. To utilize the complete functionality of the print system, all these resources are required.
Printing in the Oracle Solaris OS consists of the software to support the following:
Print commands
Print spooler
Over-the-wire protocol
Underlying technologies that move a print request from the client to the server, and, or the printer
The following figure is a high level diagram that represents the print system components.
Recent changes in Oracle Solaris printing include the integration of IPP client-side support, implemented through the PAPI. The Berkeley Software Distribution (BSD) and System V (SysV) commands, as well as some applications, are layered on top of the PAPI interface. See Implementation of the Open Standard Print API.
The following tools can be used to set up and manage printers in the Oracle Solaris 10 OS:
Solaris Print Manager – Is a graphical user interface (GUI) that enables you to manage printing configuration on a local system or in a naming service.
LP print service commands – Is a command-line interface (CLI) that is used to set up and manage printers on a local system or in a naming service. These commands also provide functionality that extend beyond the other print management tools.
The following interfaces, protocols, and technologies are supported in the Oracle Solaris release:
Internet Printing Protocol (IPP)
Server Message Block (SMB) protocol, through Samba
Berkeley Software Distribution (BSD) protocol
The Oracle Solaris implementation of the Open Standard Print API, also referred to as PAPI, makes it possible to layer applications, toolkits and print commands on top of a print service, protocol neutral interface. This implementation can be used with RFC-1179, IPP-based, and LP-based printing services. Printer, server, and job attributes, as well as job submission and queries to a printer, are among the supported PAPI functions. This support enables the print client, be it an application, or the print commands themselves, to query the print system about the characteristics of a printer and to request information.
For more information, see the following references:
Historically, printing commands have been tied to a specific print system because they have been implemented on top of print system specific protocols and interfaces. Examples include the IPP, BSD, LPR, SysV LP, and LPRng, printing protocols. The introduction of the PAPI, makes it possible to layer these print commands on top of a print service, protocol neutral, interface
The PAPI provides applications a single interface for print service interaction. This means that applications can be written to use this interface and work with a variety of print services without requiring changes to the applications. Applications are no longer tied to a particular print service, such as the LP print service or CUPS. Instead, print services can easily be replaced on a system without impacting the protocol or application layers above. Ultimately, print services can be both developed and selected based on specific needs.
The PAPI implementation in the Oracle Solaris OS provides both server-side and client-side support for IPP, which is layered on top of the PAPI. IPP is implemented as a set of protocol-specific libraries and an Apache module. Like the command implementations, the IPP Listening Service can be used with any printing service that supports the PAPI. Server-side support for the RFC-1179 protocol is also available.
A print server is a system on which a print queue is configured and makes the printer available to other systems on the network. A print client is a system that utilizes configured print queues.
Printers can also be divided into two categories, local and remote. A local printer refers to a print queue that has been defined on a system that is local to you. A remote printer refers to a print queue that is defined anywhere but your local system. These terms do not have anything to do with whether the printer is physically attached to a system or to the network, but rather where the print queue was configured. Where the print queue is configured determines the server for that printer. Often, the print server supporting a building full of printers is the same system.
Another way to view printers and printer setup is how they are connected to the world. Some printers are directly attached to the print server by a wire. These printers are referred to as attached printers. If a printer is attached to the network, rather than to a desktop or server, it is referred to as a network—attached printer. The terms local and remote refer to print queue configuration. The terms directly attached and network-attached refer to the physical connection of the printer hardware. Referring to a printer as an attached or a network-attached printer defines the way the printer is physically connected. When you are referring to a local or a remote printer, you are referring to how the print queue for that printer was defined. Sometimes, the use of these terms can be confusing, because a printer that is physically attached to a system also most likely has a print queue that was defined on a local system. Similarly, print queues for network printers are more than likely defined on a system that is remote to your local system. This is the reason that attached and network printers are often referred to as local and remote printers.
IPP is a fairly recent industry standard network printing protocol that is used for client-to-server and server-to-printer communications. This protocol provides a basic model that includes printers and jobs, standard attributes for these printers and jobs, and a set of standard operations that can be performed against these printers and jobs. Because the objects, attributes, and operations are standardized, IPP is a method for communicating between client and server systems. In the Oracle Solaris OS, server-side support for this protocol is provided by an IPP listening service. IPP client-side support in the Oracle Solaris OS is implemented through the PAPI. IPP printer support is available through the URI interface script.
For step-by-step procedures and additional background information that is in this document, see Configuring the Internet Printing Protocol and Appendix A, Using the Internet Printing Protocol.
Also referred to as the BSD protocol, the RFC-1179 protocol is an existing over-the-wire protocol that is widely used for communicating between print clients and servers and network-attached printers that are configured by using the LP print service or Solaris Print Manager. The Request for Comments (RFC) 1179 describes the protocol that a line printer daemon client uses to control printing. Developed originally for BSD UNIX, the RFC-1179 printing protocol has long been the cross-platform standard for printing. You can use this protocol to perform basic printing tasks, such as submitting and canceling print jobs, and obtaining print job status. The RFC-1179 protocol is able to communicate with LPD-based print servers and any other print server that accepts the BSD printing protocol. Many network-attached printers offer this protocol as an option for transferring job data.
The RFC-1179 protocol has served for decades as the standard network printing protocol. The protocol was originally designed to perform a very limited set of operations. The RFC-1179 protocol lacks a common representation for status information. In addition, this protocol offers only basic print job options. Conversely, the design of IPP includes features that are lacking in the RFC-1179 and BSD protocols. With IPP, a broad set of operations can be performed. These operations make use of a core set of common attributes by using a common representation and encoding method. Also, IPP enables encryption and authentication to be used between a print client and a print server. Finally, IPP provides a means for extending operations and attributes, while maintaining backward compatibility and interoperability. One of the results of the evolution of the RFC-1179 protocol is that it has several conflicting vendor extensions to overcome, making IPP the preferred choice of printing protocols.
For more information about using IPP to set up and administer printers, see Configuring the Internet Printing Protocol and Appendix A, Using the Internet Printing Protocol.
The SMB protocol is an application-level network protocol that is primarily used for sharing printers, access to files, serial ports, and miscellaneous communications between nodes on the network. Mainly used by Windows systems, SMB is an authenticated inter-process communication mechanism. In the Oracle Solaris OS, the SMB protocol is used primarily for sharing printers. All of these processes take place over the network. SMB can run over multiple protocols.
SMB works through a peer-to-peer approach. A client makes a specific requests to a server, and the server responds accordingly. SMB servers make their file systems and other resources available to clients on the network. In the Oracle Solaris OS, SMB includes Samba server-side support that is managed by the Service Management Facility (SMF) and Samba smbclient client-side support. To access a Windows hosted printer, setup of a local print queue is required. This requirement is due to differences in UNIX and Windows printing models.
Samba is an open-source SMB server freeware application that uses the SMB protocol. Samba provides Windows clients access to UNIX servers and UNIX clients access to Windows servers. The access that is provided is for both files and other services, including printer sharing. Samba's design, as well as constraint, is to operate on top of a variety of existing UNIX systems. Samba runs as a set of daemons and services, without any need for modification of existing kernels. More information about Samba can be found at http://www.samba.org.
The printing architecture in the Oracle Solaris OS uses network printing protocols to communicate with print services in following ways:
Client-to-server communications
Server-to-printer communications
The Oracle Solaris software provides applications, toolkits, printing commands, and an application programming interface that interacts with print services. This API is called the PAPI. The PAPI consists of a front-end API implementation that dynamically loads back end print service or protocol modules that communicate directly with print services. These print services contain the print job or print queue that is being acted upon. Client-to-server communications include the RFC-1179 and IPP protocols, as well as support for communicating with a local LP print service. For server-to-printer communications, the network printing protocol support enables the print service to transmit print jobs directly to network-attached printers.
Server-to-printer communications for the LP print service and Solaris Print Manager include support for the following network protocols:
Raw Transmission Control Protocol (TCP) socket
RFC-1179
IPP
SMB
The print System uses two over-the-wire protocols for sending print requests from a print client to the print server. The following table describes the printing protocols that can be used for printing in the Solaris OS.
Table 1–1 Supported Printing Protocols
Network Printing Protocol |
Server-Side Support? |
Client-Side Support? |
For More Information |
---|---|---|---|
Internet Printing Protocol (IPP) |
Server-side support for the IPP listening service is available, starting with the Oracle Solaris 10 release. |
Supported in some Oracle Solaris releases. | |
RFC-1179 protocol |
Supported in all Oracle Solaris releases. |
Supported in all Oracle Solaris releases. | |
SMB protocol, through Samba Note – The SMB protocol, through Samba, is an implementation that enables interoperability between Linux and UNIX servers, and Windows-based clients. |
Supported, starting with the Solaris 9 OS. |
Supported, starting with the Solaris 9 OS. |
Applications, toolkits, and printing commands select the protocol to use for client-to-server communications, based on the value of the printer-uri-supported attribute that is found in the printers.conf database entry for the specified print queue. This value is automatically generated and populated when access to a remote print queue is configured by using the lpadmin command or when an application uses the interface that is being referenced to perform an action or actions.
For example, when printing a document while using Mozilla, the path that is followed to gain access to the printer is:
Mozilla -> lp -> PAPI
For more information, see the printers.conf(4)
The lpadmin command generates printer-uri-supported values using the following format:
{ipp|lpd}://server/printers/queue
To determine which URI to use in the printers.conf database, the lpadmin command probes the remote print service. If the remote print service supports IPP, this protocol is preferred over the BSD protocol. However, you can override automatic protocol selection by specifying the -soption with the lpadmin command, then supplying a different URI. For more information, see the Printer URI Formats That Are Supported.
The LP print subsystem uses the BSD print protocol, also referred to as the RFC-1179 protocol, and raw Transmission Control Protocol (TCP), the basic communication language or protocol of the Internet, to communicate with the printer. If you are setting up a printer that includes printer vendor documentation, information about which protocol to use is provided. The TCP protocol is the protocol that is most often used for printing on the network.
The following table describes supported printer URI formats:
Table 1–2 Supported URI Formats
Command |
URI Format |
---|---|
lpsched |
lpsched://localhost/printers/queue This printer URI scheme can only be used to contact a local LP service to access the print queue that is specified in the URI. |
lpd |
lpd://localhost/printers/queue[#extensions] Use this URI format to contact local or remote print services for the purpose of accessing a print queue on the host that specified in the URI. An optional #extensions can be specified, for example, #solaris. When #solaris is specified, the host processes Solaris extensions to the RFC-1179 protocol during print job submissions. |
Network-attached printers often support more than one method of communicating with a print service. The most common method of communicating with the print service is through a raw TCP connection to a well-known port on the device. Other methods of communication include the RFC-1179 and IPP network protocols. You can select the server-to-printer communication protocol when adding a new print queue in one of following ways:
By using the lpadmin command with the following options, and as shown here:
# lpadmin -o protocol={bsd|tcp} -o dest=printer:queue-or-port -m netstandard{_foomatic} |
This method for communicating with the print service was introduced in the Solaris 2.6 OS and is available in all subsequent Oracle Solaris releases.
The second method is to use the lpadmin command with the -d option to supply a device and the -m option to specify a uri.
This method for communicating with the print service is intended to replace the previous method.
When determining which protocol to use for server-to-printer communication, consult the vendor printer documentation for more specific information. Documentation includes information such as TCP port numbers, RFC-1179 printer names, and the IPP printer URIs that are supported by the device. In most instances, a raw TCP socket communication is likely to provide the most reliable results.
Also, note that due to differences between printing services on UNIX and Windows platforms, Windows hosted printers should be configured as network-attached printers and administered as such. These types of printers require the creation of a print queue if you are using them on a Oracle Solaris system. These printers might also use the SMB protocol for server-to-printer communication. For more information about the SMB protocol, see Description of the SMB Protocol.
For more information about setting up printers and configuring print queues, see Setting Up Printers by Using Solaris Print Manager (Task Map) and Setting Up Printers by Using LP Print Commands (Task Map).
Solaris Print Manager is a JavaTM technology-based GUI that enables you to manage local and remote printing configuration. This tool can be used in the files, LDAP, NIS, and NIS+ naming service environments.
To use this tool, you must meet the following requirements:
You must be logged in as superuser or assume an equivalent role.
You must subscribe to the Print Management profile.
You must have the Solaris.print.admin authorization.
Solaris Print Manager centralizes printer information when the information is used in conjunction with a naming service. Using a naming service for storing printer configuration information is the preferred method, because a naming service makes printer information available to all systems on the network. This method provides easier printer administration. Solaris Print Manager recognizes existing printer information on print servers, print clients, and in the naming service databases. No conversion tasks are required to use Solaris Print Manager as long as the print clients are running at least the Solaris 2.6 release.
The Solaris Print Manager package is SUNWppm.
The LP print service is a set of software utilities that enables users to print files while continuing to work. Originally, the print service was called the LP spooler. LP represents line printer, but the meaning now includes many other types of printers, such as laser printers. Spool is an acronym for Simultaneous Peripheral Operations Online.
The LP print service consists of the LP print service software, any print filters you might provide, and the hardware, such as the printer, system, and network connections.
Solaris 10 5/08: The LP print client commands make use of the PAPI to interact with Solaris LP (lpsched), RFC-1179 (BSD/LPD protocol), and IPP-based servers. IPP support is capable of interacting with CUPS servers by using its native IPP service. With the introduction of this API support, several common BSD and SysV printing commands use the PAPI interface. As a result, the new command implementations work with a number of existing print services. A portion of this development includes server-side support for IPP that is also layered on the API. This support is implemented as a set of protocol-specific libraries and as an Apache module, Versions 1 and 2. Similar to the print command implementation, the IPP listening service can be used with any print service that has PAPI support. The RFC-1179 server-side support is also layered on the PAPI.
For additional information about the LP print service, see LP Print Service.
This section provides an overview of the print client-server process that is used by the LP print service.
The print server is a system that has a local printer connected to it and makes the printer available to other systems on the network. The following figure highlights the part of the print process in which the print server sends the print request to the printer.
The print client submits a print request.
The print request is processed on the print client.
The print request goes to the print server.
The print request goes to the printer.
The print output is produced on the printer.
A print client is a system that can send print requests to a print server.
The following figure highlights the part of the print process in which the user submits a print request from a print client.
The following figure illustrates the path of a print request from the time the user initiates the request until the print request is printed.
A user submits a print request from a print client.
The print command checks a hierarchy of print configuration resources to determine where to send the print request.
The print command sends the print request directly to the appropriate print server. A print server can be any server that accepts Berkley Software Distribution (BSD) printing protocol, including System V Release 4 (SVR4), or LP print servers and BSD LPD-based print servers, as well as servers that accept IPP.
The print server sends the print request to the appropriate printer.
The print request is printed.
The print request follows the same path it would if the client and server were separate systems. Requests always flow from client to server following the same path.
The following figure shows what happens when a user submits a request to print a PostScript file on a local printer, which is a printer connected to the user's system. The lpsched daemon on the local system does all processing.
This processing might include the following:
Matching the printer and content type
Identifying the default printer, filtering the request
Starting the specified printer interface program
The printer interface program does the following:
Prints the banner page.
Catches printer faults.
Determines the printer fault policy to either reset, continue, or begin the print job over again.
Finally, the interface program uses the lpcat program to download the print request to the local printer's serial port.
The LP print service has a scheduler daemon called lpsched. The scheduler daemon updates the LP system files with information about printer setup and configuration.
The lpsched daemon schedules all local print requests on a print server, as shown in the following figure. Users can issue the requests from an application or from the command line. Also, the scheduler tracks the status of printers and filters on the print server. When a printer finishes a request, the scheduler schedules the next request n the queue on the print server, if a next request exists.
Without rebooting the system, you can stop the scheduler with the svcadm disable application/print/server command. Then, restart the scheduler with the svcadm enable application/print/server command. The scheduler for each system manages requests that are issued to the system by the lp command.
The following figure shows what happens when a user on a print client submits a print request to an LPD-based print server. The command opens a connection and handles its own communications with the print server directly.
The following figure shows an LPD-based print client submitting a print request to a print server. The lpd daemon handles the local part of the print request and the connection to the print server. On the print server, the inetd process waits for network printing requests and starts a protocol adaptor to service the request. The protocol adaptor communicates with the lpsched daemon, which processes the request on the print server.
The following figure shows what happens when a user on a print client submits a print request to a Solaris print server. The print command on the print client handles the local part of each print request by communicating directly with the print server.
The inetd process on the print server monitors network printing requests and starts a protocol adaptor to communicate with the lpsched daemon on the print server, which processes the print request.
Printing Task |
Topics Covered |
For More Information |
---|---|---|
Set up and administer network printing protocols. |
Setting up the IPP, RFC-1179, and SMB network printing protocols. | |
Set up and administer printers by using Solaris Print Manager. |
Setting up print servers, adding directly attached and network-attached printers, and adding print clients. |
Chapter 4, Setting Up and Administering Printers by Using Solaris Print Manager (Tasks) |
Set up and administer printers by using LP print commands. |
Setting up print servers, adding directly attached and network-attached printers, and adding print clients. |
Chapter 5, Setting Up Printers by Using LP Print Commands (Tasks) |
Administer printers. |
Administering printers and print requests. |
Chapter 6, Administering Printers by Using LP Print Commands (Tasks) |
Customize printing services and printers. |
Customizing printing services. Administering character sets, print forms, print filters, and print fonts. |
Chapter 7, Customizing LP Printing Services and Printers (Tasks) |
Administer printers on a network. |
Administering printers and print jobs that use the IPP, the RFC-1179, and the SMB network protocols. | |
Administer PPD files by using the PPD File Manager (ppdmgr). |
Administering PPD Files on a system by using the ppdmgr utility. |
Chapter 11, Administering Printers by Using the PPD File Management Utility (Tasks) |