Contidos dentroLocalizar Mais DocumentaçãoDestaques de Recursos de Suporte | Fazer download desta apostila em PDF (2540 KB)
Chapter 11 Printing in the Solaris Operating System (Reference)This chapter provides the following reference information for the following features: Solaris Print ManagerThis section includes reference information that pertains to using the Solaris Print Manager graphical user interface (GUI), also referred to as Print Manager (printmgr), to set up and administer printing services and printers. Printer Definitions You Can Set With Solaris Print ManagerThe following are available printer definitions when using Solaris Print Manager to set up and administer printing services and printers:
Table 11–1 describes the printer definitions that are used by Solaris Print Manager, and their availability, depending on the Solaris software release that you are running. Note – The definitions for the printer make, printer model, and printer driver are only available when you create a print queue by using the Use PPD files option in Solaris Print Manager. Table 11–1 Printer Definitions Used by Solaris Print Manager
For a detailed description of the printer make, printer model, and printer driver definitions, see Setting Printer Definitions. Note – Using PPD files is a per-queue configuration option and is not a requirement for adding a new printer. Also, PPD files are not required for printers that already contain the RIP feature. LP Print ServiceThis section describes the directory structure, files, and logs of the LP print service. LP Print Service CommandsNote – The LP Print Service client commands have been modified to be a consumer of the FSG OpenPrinting Open Standard Print API (PAPI). These print commands are layered on top of the PAPI. See How PAPI Is Implemented in the Solaris OS for more information. The following table lists frequently used LP print service commands. Table 11–2 LP Print Service Commands
For information about Solaris print commands that have been modified for use with the PAPI, see How PAPI Is Implemented in the Solaris OS. Daemons and LP Internal FilesThe /usr/lib/lp directory contains daemons and files used by the LP print service, as described in the following table. Table 11–3 Contents of the /usr/lib/lp Directory
LP Print Service DirectoriesThe files of the LP print service are distributed among the directories that are shown in the following table. Table 11–4 Directories for the LP Print Service
LP Print Service Configuration FilesThe lpsched daemon stores configuration information in the /etc/lp directory, as described in the following table. The configuration files listed in this table are private interfaces. These files are subject to change in future releases. You should not build software that relies on these files being in their current locations or that relies on the data being in the format currently used. Table 11–5 Contents of the /etc/lp Directory
These configuration files serve a function similar to the /etc/printcap file on LPD-based print servers. Note – You can check the contents of the configuration files, but you should not edit these files directly. Instead, use the lpadmin command to make configuration changes. Your changes are written to the configuration files in the /etc/lp directory. The lpsched daemon administers and updates the configuration files. The /etc/lp/printers directory has a subdirectory for each local printer that is known to the system. The following example shows the /etc/lp/printers subdirectories of printers sparc1 and luna.
The following table describes the files within each printer-specific directory.
The configuration file for the printer luna, /etc/lp/printers/luna/configuration, would typically appear as follows:
The terminfo DatabaseThe /usr/share/lib directory contains the terminfo database directory. This directory contains definitions for many types of terminals and printers. The LP print service uses information in the terminfo database to perform the following tasks:
Each printer is identified in the terminfo database with a short name. For a description of the structure of the terminfo database, see Printer Type. If necessary, you can add entries to the terminfo database, but doing so is tedious and time-consuming. For more information, see Adding a terminfo Entry for an Unsupported Printer. Printer Names in the terminfo DatabaseInformation about each printer type is stored in the terminfo database (/usr/share/lib/terminfo). This information includes the printer capabilities and initialization control data. The printer you install must correspond to an entry in the terminfo database.
Each subdirectory contains compiled database entries for terminals or printers. The entries are organized by the first letter of the printer or terminal type. For example, if you have an Epson printer, look in the /usr/share/lib/terminfo/e directory to find your particular model of Epson printer.
The entries for Epson printers begin with epson. If you have an NEC printer, look in the /usr/share/lib/terminfo/n directory for your NEC printer model.
The nec entry in this directory is for the NEC printer. LP Print Service Log FilesThe LP print service maintains two sets of log files that are described in the following table.
Print Queue LogsThe scheduler for each system keeps a log of print requests in the /var/spool/lp/tmp/system and /var/spool/lp/requests/system directories. Each print request has two files, one file in each directory, that contain information about the request. The information in the /var/spool/lp/requests/system directory can be accessed only by superuser or lp. The information in the /var/spool/lp/tmp/system directory can be accessed only by the user who submitted the request, superuser, or lp. The following example shows the contents of the /var/spool/lp/tmp/starbug directory:
These files remain in their directories only as long as the print request is in the queue. Once the print request is finished, the information in the files is combined and appended to the /var/lp/logs/requests file. This file is described in the next section. Use the information in the /var/spool/lp/logs directory if you need to track the status of a print request that is currently in the queue. History Log FilesThe LP print service records a history of printing services in two log files, lpsched and requests. These log files are located in the /var/lp/logs directory. You can use the information in these log files to diagnose and troubleshoot printing problems. An example of the contents of the /var/lp/logs directory is as follows:
The two most important log files for troubleshooting are the following:
The requests log file has a simple structure so that you can extract data using common UNIX shell commands. Requests are listed in the order they are printed. They are also separated by lines showing their request IDs. Each line below the separator line, the line that starts with =, is marked with a single letter that identifies the kind of information contained in that line. Each letter is separated from the data by a single space. The following example shows the contents of a requests log file:
The following table shows the letter codes and the content of their corresponding lines in the requests log file. Table 11–6 Codes in the requests Log File
The following table shows the outcome codes in the LP requests log file and their descriptions. Table 11–7 Outcome Codes in the requests Log File
Spooling DirectoriesFiles queued for printing are stored in the /var/spool/lp directory until they are printed, which might be only seconds. The following table shows the contents of the /var/spool/lp directory. Table 11–8 Contents of the /var/spool/lp Directory
Filtering Print FilesPrint filters are programs on the print server that convert the content of a queued file from one format to another format. A print filter can be as simple or as complex as needed. The Solaris OS provides print filters in the /usr/lib/lp/postscript directory that cover most situations where the destination printer requires the data to be in PostScript format. If you need filters for nonPostScript printers, you have to create the filters and add them to the systems that need filters. A set of print filter descriptor files are provided in the /etc/lp/fd directory. These descriptor files describe the characteristics of the filter (for example, fast or slow filter). These description files point to the filter program (for example, to /usr/lib/lp/postscript/postdaisy). How the Printer Interface Program WorksThe LP print service interacts with other parts of the Solaris OS. The print service uses a standard printer interface program to do the following:
The LP print service uses the standard interface program, found in the /usr/lib/lp/model directory, unless you specify a different program. You can create custom interface programs. However, you must make sure that the custom program does not terminate the connection to the printer or interfere with proper printer initialization. Using PPD Files To Set Up PrintersSupport for setting up and administering printers with PPD files has been incorporated into the Solaris print subsystem. Two interface scripts, standard_foomatic, and netstandard_foomatic, are available. These interface scripts provide the generic Solaris interface between the Solaris spooler and the back-end process of the Solaris print server. The following are examples of the types of printers that are supported:
Raster Image Processor SupportThe raster image support in the Solaris OS (RIP) enables you to print to printers that do not have resident PostScript processing capabilities. The Solaris printing software provides the print server RIP and supporting technologies. The RIP occurs behind the scenes. However, to use the appropriate driver you need to configure each printer by using either Solaris Print Manager or the lpadmin -n command. For step-by-step instructions on using the lpadmin -n command, see How to Add a New Directly Attached Printer by Using LP Print Service Commands. Support for PostScript Printer Description FilesThe lpadmin and lpstat commands, as well as the Solaris Print Manager printer definition screens, support the use of PPD files. The following new software packages are associated with this feature:
For more information about supported printers, see Where to Find Information About Supported Printers and Available PPD Files. Where to Find Information About Supported Printers and Available PPD FilesThe location where the PPD files and the ppdcache file is stored are private, as is the contents of the ppdcache file. The placement of these files and the contents of the ppdcache are subject to change. Do not build software that relies on these files being in their current location or that relies on the data being in the format that is currently used. If the file required by your printer is not available, you can add your own PPD file. If you use the lpadmin -n command to create a new print queue, you can store your own PPD files anywhere that you choose. If you are running the Solaris 10 OS, and you use Solaris Print Manager to create the print queue, the PPD file must have an entry in the ppdcache file. If you are running at least the Solaris Express Developer Edition 5/07 release, PPD files are located in any of following four repositories on the system:
Copies of PPD files that are specified by using the lpadmin command with the -n option, or by using the -a option with the ppdmgr command are stored in the user repository under the same PPD file name. If you use the ppdmgr utility with the -a and the -R options, a copy of the specified PPD file can be stored in the admin repository. If you create a print queue with Solaris Print Manager, and no entry exists for the PPD file in the ppdcache file, you can use the ppdmgr utility to add the file to the system. The cache of PPD file information that Solaris Print Manager uses is then updated to reflect any changes you make by using either of these two methods. If you are not running at least the Solaris Express Developer Edition 5/07 release, PPD files are located in the /usr/lib/lp/model/ppd/system directory or any alternate directory that you specify. The output of the ls command lists all the PPD files for a particular printer manufacturer. For additional task-related information, see Administering Printers That Are Associated With PPD Files (Task Map). PPD File Management UtilityThis section contains reference information for managing PPD files. When the ppdmgr utility is used to add a PPD file to the system, a compressed (gzipped) copy of the specified PPD file is stored on the system. The purpose is to maintain a current cache of PPD file information from all known PPD files on the system. The full path of the PPD file that is copied to the system follows:
The following figures show the layout of a typical PPD file repository and the ppdmgr utility directory layout, which contains all relevant ppdmgr delivered and generated files, including the PPD user file repository.
PPD File RepositoriesThe following table describes the PPD file repositories that are located on a system. Table 11–9 Description of the PPD File Repositories
The location of the PPD files and the ppdcache file is private and is therefore subject to change. Do not build software that relies on these files being in their current location or the data being in its current format. PPD File LabelsOn a system that is running the Solaris software, PPD files can be stored default label directories. You can also specify a label of your own choosing to organize PPD files, as long as the label is not reserved by the system. The following label names are reserved:
With the exception of the all label name, these label names cannot be specified by using either the -L or -R options of the ppdmgr utility. However, you can specify the all label name with the -L or the -R option when using the -r and -u options. Any label name that begins with SUNW is reserved for use by Sun, but is not prohibited. If you add a PPD file to a system and specify a label that does not exist, a directory with that label name is created in the specified repository. By default, if no PPD file repository is specified, this directory is /var/lp/ppd/label. For more information about specifying labels when you add PPD files to a system, see Description of the Command-Line Options for the ppdmgr Utility. Description of the Printer Driver Field in Solaris Print ManagerThe Printer Driver field in Solaris Print Manager is displayed when you select the Add New Printer (attached or network) or Modify Printer Attributes (attached or network) menu options. This field contains printer driver descriptions from the PPD cache file, based on the printer model that you select. To distinguish between duplicate printer driver descriptions that have different labels within the PPD file repositories, the label and abbreviation of the PPD file repository name is also displayed. The format that is used for the printer driver description is as follows: label(repository-letter): driver-description For example, the following PPD file is located in the PHOTOS label within the user PPD file repository: /var/lp/ppd/PHOTOS/HP/HP-PhotoSmart_P1100-hpijs.ppd.gz This PPD file would appear in Solaris Print Manager's Printer Driver field selection list as follows: PHOTOS(U): Foomatic/hpijs (recommended) In the following example, the following PPD file is located in the SUNWfoomatic label within the system PPD file repository: This PPD file would appear in Solaris Print Manager's Printer Driver field selection list as follows: SUNWfoomatic(S): Foomatic/hpijs (recommended) The following table describes the PPD file repository letters, the repositories they represent and the location of the repositories a the system.
Manufacturer Aliases FileManufacturer directories, one for each manufacturer, are located in the PPD repositories on a system. When PPD files are added to a system, the manufacturer name that is contained in the PPD file is used to determine which manufacturer directory to copy the PPD file to. A private file, /var/lp/ppd/manufaliases, contains aliases for all the manufacturer entries in a PPD file. The manufaliases file is referenced to determine which manufacturer directory to copy the PPD file to. This process ensures that there is one directory per manufacturer, rather than one directory per manufacturer alias. For example, if a PPD file contains the manufacturer name, Hewlett-Packard, and an HP alias for Hewlett-Packard is listed in the manufaliases file, the PPD file is stored in the HP directory. This strategy applies to all PPD files that are added to a system by using the ppdmgr utility and the lpadmin -n command. Note – The manufaliases file is a private file. Do not edit this file. Do not build software that relies on the file being in its current location or the data being in its current format. PPD File CachesPrivate PPD file caches are maintained in the /var/lp/ppd/caches/ directory, one for each label within each repository. The format of the cache file name that is used follows: PPD-repository: label The information about PPD files that is in the PPD cache files is maintained by using the ppdmgr utility. Do not edit the PPD cache files manually. Note that the cache files in the /var/lp/ppd/caches directory are used to generate the private PPD cache file, /var/lp/ppd/ppdcache. This file is used by the printmgr utility. For more information, see the printmgr(1M) man page. Note – The location of the ppdcache and it's contents is private. Do not build software that relies on this file being in its current location or on the data being in its current format. This information applies to any private files that are generated or delivered for use by the ppdmgr utility. Description of the Command-Line Options for the ppdmgr UtilityIn this section, the command-line options for the ppdmgr utility are described. Additional information about processes, guidelines, and restrictions for administering PPD files by using the ppdmgr utility are also described. The PPD Manager (ppdmgr) utility is located in /usr/sbin/ppdmgr. To add a PPD file to a system, you would use the following syntax:
The -a option copies the PPD file that is specified in ppd-file-path to the PPD repository, then updates the PPD cache file to reflect the change. If you do not specify a PPD file repository by using the -R option, the PPD file is stored in the user PPD file repository. If you do not specify a label by using the -L option, the PPD file is stored in the user label directory. The following verifications are performed when you use the -a option with the ppdmgr utility:
Note – If you provide information that does not pass the various verification checks, or if any of the actions that are performed by the ppdmgr utility are unsuccessful, an error message is displayed, and the utility exits. Additional Actions Performed:
To specify PPD file repository, you would use the following syntax:
The -R option with repository is used to identify one of the supported PPD file repositories. When the -R option is not specified, the default repository is user. When the -R option is specified with the -a option, the valid repository names are user and admin. See PPD File Repositories for more information about all of the supported repository names and their locations. To specify a label, you would use the following syntax:
The -L option with the label-name is used to identify a grouping of PPD files within a PPD file repository. The label is also the name of the directory that is located in the PPD file repository. The label can be comprised of any characters from the portable character set. However, the label cannot contain a semicolon (;). When the -L option is not specified, the following are the defaults that are used for specifying a label name.
To request an update of the PPD cache file, you would use the following syntax:
This option updates the cache file to reflect modifications within PPD file repositories. The PPD cache file is updated only if modifications are detected. Note – When the -a option is specified, an update of the PPD cache file occurs automatically to reflect the change in the label directory within the repository where the PPD file was copied. When the -R or -L option is not specified, the PPD cache file is updated to reflect modifications in the all label directory within the user repository. To request a rebuild of PPD cache file, you would use the following syntax:
The -r option rebuilds the cache by removing and regenerating any intermediary cache files that are associated with the specified label within the specified PPD file repository. This action results in an update of the PPD cache file, /var/lp/ppd/ppdcache, if any intermediary cache files are removed. Because a regeneration of the specified label within the specified PPD file repository is required, the regeneration of the PPD cache information can be very time-consuming. The time that it takes to rebuild the PPD cache file depends upon the number of PPD files that are affected, Therefore, the -r option should only be used when PPD cache file corruption is suspected. When the - R or - L option is not specified, intermediary cache files that are associated with all of the labels within the user PPD file repository are removed. These modifications are then reflected in the PPD cache file. To display the full path of PPD File in the repository, you would use the following syntax:
The -w option must be specified with the -a option, and the PPD file is added to the system successfully, the full destination path of the PPD file is displayed on stdout. Otherwise, this option is ignored. How PAPI Is Implemented in the Solaris OSThis section contains additional background information about the FSG OpenPrinting Open Standard Print Application Programming Interface (PAPI), a print service-independent interface for accessing printing support on a local host or a network. The PAPI contains a set of printing related objects or data structures and a set of operations or functions to manipulate the objects. The following are supported tasks:
Modified Solaris Print CommandsTable Table 11–10 describes the Solaris print commands that have been modified for use with the PAPI. Table 11–10 Modified Solaris Print Commands
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||