The Solaris Print Service
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":
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 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:
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.
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.
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.
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.
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:
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.