Previous Page
Next Page

The Solaris Print Service

Objective:

Describe the purpose, features, and functionality of printer fundamentals, including print management tools, printer configuration types, Solaris LP print service, LP print service directory structure, and the Solaris operating environment printing process.

The Solaris print service is a default cluster that is installed when the operating system is initially installed. The function of the Solaris print service is described later in this chapter. To verify that the package is installed, you should look for the following software packages by using the pkginfo command as described in Chapter 2, "Installing the Solaris 10 Operating Environment":

Package

Description

SUNWlpmsg

ToolTalk programs for passing printer alerts.

SUNWfdl

Solaris Desktop Font Downloader for Adobe PostScript printers.

SUNWscplp

Solaris Print-Source Compatibility package. This package contains print utilities for user-interface and source-build compatibility with SunOS 4.x. These utilities are located in the /usr directory.

SUNWslpr

root (/) file system portion of the Service Location Protocol (SLP) framework. Includes the SLP configuration file and start scripts for the SLP daemon.

SUNWslpu

/usr file system portion of the SLP framework.

SUNWmp

MP (make pretty) print filter.

SUNWpcr

Solaris print client configuration files and utilities for the print service (root).

SUNWpcu

Solaris print client configuration files and utilities for the print service (usr).

SUNWppm

Solaris Print Manager.

SUNWpsr

Configuration and startup files for the print service.

SUNWpsu

Solaris Print-LP Server configuration files and utilities for the print service (usr).


Note

SLP SLP is an Internet Engineering Task Force (IETF) protocol for discovering shared resources (such as printers, file servers, and networked cameras) in an enterprise network. The Solaris 10 operating environment contains a full implementation of SLP, including application programming interfaces (APIs) that enable developers to write SLP-enabled applications. SLP also provides system administrators with a framework for ease of network extensibility.


Setting up a Solaris printer involves setting up the spooler, the print daemon, and the hardware (that is, the printer and the printer port). The system administrator needs to verify that the computer has at least 200MB of disk space available for /var/spool/lp. Print files will be sent to this location to be prepared for printing. Other configuration files are created, but Solaris takes care of that part for you. When you are setting up a printer, Solaris makes the required changes in the system's /etc/printers.conf file and the /etc/lp directory.

LP Print Service Directories

The LP print service includes the following directory structure, files, and logs:

  • /usr/bin This directory contains the LP print service user commands.

  • /usr/sbin This directory contains the LP print service administrative commands.

  • /usr/share/lib/terminfo This directory contains the terminfo database, which describes the capabilities of devices such as printers and terminals. The terminfo database is discussed later in this chapter.

  • /usr/lib/lp This directory contains the LP print service daemons, binary files used by the print service, PostScript filters, and default printer interface programs.

  • /usr/lib/lp/model This directory contains default printer interface programs (shell scripts) called standard and netstandard. The print service runs the standard interface script on local printers to do the following:

    • Initialize the printer port.

    • Initialize the printer.

    • Print a banner page.

    • Print the correct number of copies, as specified in the user's print request.

The netstandard script is designed to support network printers. It collects the spooler and print database information and passes this information on to /usr/lib/lp/bin/netpr. netpr in turn opens the network connection and sends the data to the printer.

When a print request is sent to a printer queue, the print service runs through the printer's standard script, which performs the following functions:

  • Initialize the printer port.

  • Initialize the actual printer, using the terminfo database to find the appropriate control sequences.

  • Print a banner page if configured to do so.

  • Print the specified number of copies.

Printer interface file templates are located in the /usr/lib/lp/model directory. When a printer queue is created, this template file is copied to the /etc/lp/interfaces directory. The name of the interface file reflects the name of the printer. For example, a printer named hplet1 would have an interface file named /etc/lp/interfaces/hpljet1. Printer interface files are scripts that can be modified as needed to change the behavior of the printer, such as turning off the banner page and enabling two-sided printing.

  • /usr/lib/lp/postscript This directory contains all the PostScript filter programs that the Solaris LP print service provides. Print filters are used to convert the content of the print request to a format that is accepted by the destination printer.

  • /etc/lp This directory contains the LP service configuration files. These files are edited by using the print service configuration tools described later in this chapter.

  • /etc/lp/fd This directory contains a set of print filter descriptor files. The files describe the characteristics of the filter and point to the actual filter program.

  • /etc/lp/interfaces This directory contains each printer interface program file which is copied from the /usr/lib/lp/model directory as described earlier. Entries in this directory are specific for each printer installed on the system.

  • /etc/lp/printers This directory contains subdirectories for each local printer attached to the system. Each subdirectory contains configuration information and alert files for each printer.

  • /var/spool/lp All current print requests are stored here until they are printed.

  • /var/lp/logs This directory contains a history log of print requests.

The Print Spooler

Spool stands for simultaneous peripheral operations online. The spooler is also referred to as the queue. Users execute the print spooler lp program when they want to print something. The print spooler then takes what the user wants to print and places it in the predefined /var/spool/lp print spooling directory.

Spooling space is the amount of disk space used to store and process requests in the print queue. The size of the /var directory depends on the size of the disk and how the disk is partitioned. If /var is not created as a separate partition, the /var directory uses some root partition space, which is likely to be quite small. A large spool directory could consume 600MB or more of disk space. To get a feel for this, you should look at the size and partitioning of the disks available on systems that could be designated as print servers.

When connecting printers, you need to first carefully evaluate the users' printing needs and usage patterns. If users typically print only short ASCII files, without sophisticated graphics or formatting requirements, a print server with 200MB to 300MB of disk space allocated to /var is probably sufficient. However, if many users are printing lengthy PostScript files, they will probably fill up the spooling space quite frequently. When /var fills up and users cannot queue their jobs for printing, workflow is interrupted. The size of /var is set when the operating system is loaded and disks are partitioned.

Caution

Running Out of Space in /var Some print jobs consume large amounts of disk space. In fact, one of my clients had a report that consumed more than 800MB when it was spooled to the printer. When /var runs out of disk space, many system functions cannot continue, such as printing, message logging, and mail. Make sure you provide adequate space in /var when setting up your system.


The SVR4 lp program is equivalent to the BSD lpr print program. In SunOS the print spooler is located in /usr/spool.

Note

BSD Print Systems Throughout this chapter, I make reference to the BSD print system for system administrators who might be familiar with it. The BSD printing protocol is an industry standard. It is widely used and provides compatibility between different types of systems from various manufacturers.


For sites that have a mix of BSD and SVR4 Unix, Sun has provided compatibility for both print systems in Solaris.

The LP Print Daemons

The /usr/lib/lp/local/lpsched daemon, also called the print scheduler, is the Unix utility that is responsible for scheduling and printing in Solaris 10. The lpsched daemon is started by the service management facility command, svcadm. For example, to start the lpsched print service, type

svcadm enable application/print/server

To shut down the lp print service, type

svcadm disable application/print/server

For compatibility, the /usr/lib/lpsched and /usr/lib/lpshut scripts are still available for starting and stopping the lpsched daemon, but these commands simply run the appropriate svcadm enable and svcadm disable commands.

Each print server has one lpsched daemon, which is started by the svc:/application/print/server:default service when the system is booted (provided a printer has been configured on this server). lpsched is also started automatically when a printer is added using the lpadmin command and disabled when the last printer has been removed.

The lpsched daemon starts or restarts the lp print service. Sometimes lpsched is referred to as the lp daemon. The lpsched print daemon takes output from the spooling directory and sends it to the correct printer. lpsched also tracks the status of printers and filters on the print server. lpsched is equivalent to the line printer daemon (lpd) in BSD Unix.

The service that handles the incoming print request from the network is svc:/application/print/server:default. You can check the status of this service using the svcs command described in Chapter 3 as follows:

svcs svc:/application/print/server

You can enable or disable the service using the svcadm command described earlier in this section.

The Internet services daemon, /usr/sbin/inetd, is started at bootup by the SMF, and it listens for service requests that are currently enabled. When a request arrives, the inetd daemon executes the server program that is associated with the service. The inetd daemon is described in Chapter 8, "The Solaris Network Environment." Print servers listen for print requests with the inetd daemon. When receiving a request, inetd starts the protocol adaptor in.lpd daemon, which is managed by the svc:/application/print/rfc1179:default service. The protocol adaptor translates the print request, communicates it to the print spooler, and returns the results to the requester. This protocol adaptor starts on demand and exits when it has serviced the network request, eliminating idle system overhead for printing.

Many methods can be used to define a printer on a Solaris system. Table 6.1 describes the tools Solaris provides for adding printers.

Table 6.1. Solaris Tools for Adding Printers

Utility

Description

Solaris Print Client

An interface that was previously available only with the Solstice AdminSuite set of administration tools. It is now available as part of the standard Solaris distribution software and is used to set up print clients.

Print Manager

A GUI that is used to manage printers in a name service environment. Print Manager is somewhat limited for advanced tasks.

LP print service commands

The command-line utilities that are used to set up and manage printers. These commands provide complete functionality.



Previous Page
Next Page