System Administration Guide: Solaris Printing

Chapter 9 Administering Printers by Using the PPD File Management Utility (Tasks)

This chapter describes how to use the PPD File Manager, /usr/sbin/ppdmgr, utility to administer PostScript Printer Description (PPD) files that are used with the Solaris print subsystem. The ppdmgr utility enables you to customize printers and automates a variety of administrative printing tasks.

This is a list of information in this chapter:

For reference information, see PPD File Management Utility.

Administering PPD Files by Using the PPD File Management Utility (Task Map)

Table 9–1 Administering PPD Files by using ppdmgr: Task Map

Task 

Description 

For Instructions 

Add a PPD file to a system by using the ppdmgr utility.

Use the ppdmgr utility to add a PPD file to the system.

How to Add a PPD File to a System by Using the ppdmgr Utility

Add a PPD file to a system by using the lpadmin -n command.

Use the lpadmin -n command to modify an existing print queue to associate a PPD file with it.

How to Add a PPD File to a System by Using the lpadmin -n Command

Request an update or a rebuild of the PPD cache file that is associated with a specific label or all labels. 


Note –

Depending on the number of PPD files to process, a rebuild of the PPD cache file can be time-consuming.


Use the ppdmgr utility to request an update of the PPD cache file, if you added a PPD file manually or by using the pkgadd command.

If you suspect the PPD cache file has become corrupted, you can request a rebuild of the PPD cache file information for PPD files in these locations:

  • In a specified label directory within a specified repository on a system

  • Within all the repositories on a system

How to Update or Rebuild the PPD Cache File by Using the ppdmgr Utility

Enable the application/print/ppd-cache-update service.

The application/print/ppd-cache-update service must be online to reflect changes made to PPD file repositories in the PPD cache. This service is enabled by default. You can enable the service by using the svcadm command, if necessary.

How to Enable or Disable the ppd-cache-update Service

Disable the application/print/ppd-cache-update service.

Use the svcadm command to disable the application/print/ppd-cache-update service.

How to Enable or Disable the ppd-cache-update Service

Overview of the PPD File Management Utility

To provide support for a wide range of printers, the Solaris print system has the ability to use PostScript Printer Description (PPD) files. The PPD File Manager (/usr/sbin/ppdmgr) provides a means of administering PPD files on a system. This utility enables you to add PPD files to the system and update printer information for printers that are not yet supported in the running Solaris OS.

With the ppdmgr utility, you can perform the following tasks:

Adding PPD Files to a System

When you add or modify a printer by using Solaris Print Manager, a PPD cache file, ppdcache, is referenced to display printer driver information. See Description of the Printer Driver Field in Solaris Print Manager. The PPD File Management utility generates the cache file by gathering printer information from the PPD files in all of the PPD file repositories on a system. To reflect any changes that are made in Solaris Print Manager, the PPD cache file must be updated.

You can use the following methods to add a PPD file to a system:

When you add a PPD file to a system by using the ppdmgr utility or the lpadmin -n command, the changes are reflected in Solaris Print Manager. If the PPD file is manually copied to the system or added by using the pkgadd command, you can use the ppdmgr utility to make sure that the new PPD files are reflected in the cache file that is used by Solaris Print Manager.

Using the ppdmgr utility to add a PPD file to the system provides more flexibility because you can specify what label is used and where the file is stored. The -L and -R options of the ppdmgr utility enable you to specify a label and repository of your own choosing. See Specifying a PPD File Label. If you add a PPD files to a system by using the lpadmin -n command or the ppdmgr utility and do not specify a label or repository, the PPD file is stored in the user label directory within the user repository. Similarly, if the source path to the PPD file that you provide is not from an existing PPD file label within an existing PPD file repository on the system, then the file is copied to the user label within the user repository.

Specifying a PPD File Label

A PPD file label describes a grouping of PPD files and refers to a user-selected or default directory name within a PPD file repository. When you use the ppdmgr utility to add a PPD file to the system, you can optionally specify a label. Using labels allows for easier organization of PPD files, which makes for easier identification of PPD files when you add or modify a printer by using Solaris Print Manager.

You can also specify a file label when you request an update or a rebuild of the PPD cache file by using the -u or the -r option . If you do not specify a label, the user default label is assigned to the PPD file. If you request an update or a rebuild of the PPD cache file, the default label is all, which specifies all PPD file repositories.


Note –

You cannot specify the all label when adding a PPD file to a system by using the ppdmgr utility with the -a option. See PPD File Labels for more information.


Specifying a PPD File Repository

You can specify a repository when adding a PPD file to a system by using the ppdmgr utility or when requesting an update of the PPD cache file. A repository is a directory where PPD file information is stored. More than one PPD file repository can exist on a system. PPD files that are supplied by third-party vendors are stored in the vendor repository. PPD files that are added by system administrators can be stored in the admin repository.

The following are locations where PPD files are stored on a system:

Locating PPD File Label and Repository Information in Solaris Print Manager

The Printer Driver field in Solaris Print Manager now displays the PPD file label and the PPD file repository abbreviation, in addition to the printer driver information. The addition of the label and repository information assists in the selection of the correct printer driver. This information is especially useful in situations where multiple PPD files with identical names are located on a system, within various label directories and repositories.

For more information, see Description of the Printer Driver Field in Solaris Print Manager.

Using the PPD File Manager (ppdmgr) Utility

ProcedureHow to Add a PPD File to a System by Using the ppdmgr Utility

This procedure describes how to use the ppdmgr utility to add a new PPD file to the system. You can also specify a PPD file label, PPD repository, or the source path of the PPD file, by using the appropriate arguments with the ppdmgr -a command. Note that when you add a PPD file to the system by using the ppdmgr command, the file is copied to the label and repository that you specify and then compressed.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Add the PPD file to the system.


    # ppdmgr -a ppd-file-path [ -L label ] [ -R repository ] [-w]
    
    -a

    Copies the PPD file that is specified in ppd-file-path to the PPD repository, then updates the information in the cache file to reflect the change.

    If the -L option is not specified, the default label that is assigned to the PPD file is user.

    If the -R option is not specified, the default repository that is assigned to the PPD file is user.

    ppd-file-path

    Specifies the source path to the PPD file and the name of that file. This file is used with the -a option to add a copy of ppd-file-path to the specified label within the specified repository with the specified label. The ppdmgr utility accepts a valid PPD file that has either a .ppd or .ppd.gz extension.

    -L label

    Specifies a PPD file label. The default label is user. Label names must contain characters that are in the portable file name character set. Label names must not begin with a hyphen (-) or contain a semicolon (:). Label names cannot be a reserved label name.

    The following label names are reserved and cannot be used with the -a option:

    • caches

    • ppdcache

    • manufaliases

    • all

    -R repository

    Specifies the name of a PPD file repository that represents one of the PPD file installation locations. When using this option, one of the following PPD file repositories can be specified:

    • user (default)

    • admin

    -w

    Displays the full path where the PPD file was copied. The -w option is only valid if it is used with the -a option. Otherwise, this option is ignored.

  3. Verify that the PPD file was added by using one of the following methods:


Example 9–1 Adding a PPD File to a System by Using the ppdmgr utility

This example shows how to add a PPD file, myHPprinter.ppd, to the system.

Note that in this example and the examples that follow the path that is specified varies.


# ppdmgr -a /net/somesystem/myHPprinter.ppd

The path to where the copy of the PPD file can be found on the system is /var/lp/ppd/user/HP/myHPprinter.ppd.gz.

Using this command, with the -a option, copies the file to the user label within the user repository.



Example 9–2 Adding a PPD File to a System With a Specified Label by Using the ppdmgr utility

This example shows how to add the PPD file myHPprinter.ppd, with the specified label, Photos, to the system.


# ppdmgr -a /net/somesystem/myHPprinter.ppd -L Photos

The path to where the copy of the PPD file can be found on the system is /var/lp/ppd/Photos/HP/myHPprinter.ppd.gz.

Using this command, with the -a and the -L options, copies the PPD file to the Photos label within the user repository.



Example 9–3 Adding a PPD File to a System to a Specified Repository by Using the ppdmgr Utility

This example shows how to add a PPD file, myHPprinter.ppd, to the admin repository on a system.


# ppdmgr -a /net/somesystem/myHPprinter.ppd -R admin

The path to where the copy of the PPD file can be found on the system is /usr/local/share/ppd/user/HP/myHPprinter.ppd.gz.

Using this command with the -a and -R options, copies the file to the user label directory within the admin repository.



Example 9–4 Adding a PPD File to a System With a Specified Label to a Specified Repository by Using the ppdmgr Utility

This example shows how to add a PPD file, myHPprinter.ppd, to a system, specifying the Photos label and the admin repository.


# ppdmgr -a /net/somesystem/myHPprinter.ppd -L Photos -R admin

The path to where the copy of the PPD file can be found on the system is /usr/local/share/ppd/Photos/HP/myHPprinter.ppd.gz.

Using this command with the -a, -L and -R options copies the file to the Photos label within the admin repository.



Example 9–5 Adding a PPD File to a System and Displaying the Full Path to Where the File Was Copied by Using the ppdmgr Utility

This example shows how to add a PPD file, myHPprinter.ppd, to a system, displaying the destination path of the PPD file. Use the ppdmgr command with this option to determine where on the system the PPD file was copied.


# ppdmgr -a /net/somesystem/myHPprinter.ppd -w

The path to where the copy of the PPD file can be found on the system is /var/lp/ppd/user/HP/myHPprinter.ppd.gz.

Using this command with the -a and -w options copies the specified file to the user label within the user repository.

The -w option is only valid when used in combination with the -a option. Otherwise, this option is ignored.


See Also

For a detailed description of the ppdmgr command-line options and for guidelines on adding PPD files, see Description of the Command-Line Options for the ppdmgr Utility.

ProcedureHow to Add a PPD File to a System by Using the lpadmin -n Command

This procedure shows how to use the lpadmin command to modify an existing print queue configuration to associate a specified PPD file with the print queue.

If you use the lpadmin command with the -n option to add a PPD file to a system, you cannot specify a label or a repository. Instead, the user label is assigned to the file, and the file is then copied to the user repository. If you want to specify a user-defined label or repository, use the ppdmgr utility to add the PPD file. See How to Add a PPD File to a System by Using the ppdmgr Utility.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Modify an existing print queue by associating it with a PPD file.


    # lpadmin -p print-queue -n ppd-file-path
    
    lpadmin

    Administrative command that is used to configure the LP print service.

    -p print-queue

    Specifies the print queue. Note that the print queue sometimes referred to as the printer-name.

    -n

    Copies the PPD file that is specified in the ppd-file-path to the default user label directory that is located within the default user PPD file repository.

    ppd-file-path

    Specifies the source path to the PPD file and the name of that file. This file is used with the -a option to add a copy of ppd-file-path to the system to the specified label within the specified repository. The ppdmgr utility accepts a valid PPD file with either a .ppd or .ppd.gz extension.

  3. Verify that the PPD file was added by using one of the following methods:

    • Check that the file is displayed in Solaris Print Manager:

      1. Launch Solaris Printer Manager. See How to Start Solaris Print Manager

      2. Select Modify Printer Attributes (attached or network).

      3. Select the print queue that you specified in Step 2 of this procedure.

        If the PPD file that is associated with the print queue was added successfully, it is displayed in the Printer Driver field. See Description of the Printer Driver Field in Solaris Print Manager.

    • Use the lpstat command to verify the PPD file was added:


      % lpstat -p print-queue -l

      If the PPD file was added to the print queue successfully, the PPD file name is included in the PPD field of the lpstat command's output.


Example 9–6 Adding a PPD File to an Existing Print Queue by Using the lpadmin -n Command

This example shows how to modify the print queue, printer1, to associate it with a copy of the specified PPD file.


# lpadmin -p printer1 -n /path/mynewHPppdfile.ppd

The specified PPD file is stored in /var/lp/ppd/user/HP/mynewHPppdfile.ppd.gz.


Updating the PPD Cache File

An update of the PPD cache file on a system updates the existing information in the PPD cache file.

You might the request and update of the PPD cache file on a system in the following instances:

Any changes that you make are reflected in Solaris Print Manager after the update has completed.

Rebuilding the PPD Cache File

A rebuild of the PPD cache file removes the existing cache and builds a completely new cache. This process can be time-consuming, especially if many PPD files are on the system. Therefore, only request a rebuild of the PPD cache file in troubleshooting situations. For guidelines that pertain to updating and rebuilding the PPD cache file, see Description of the Command-Line Options for the ppdmgr Utility.

ProcedureHow to Update or Rebuild the PPD Cache File by Using the ppdmgr Utility

This procedure describes how to update or rebuild the PPD cache file by using either the -u or the -r option of the ppdmgr utility.

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Update or rebuild the PPD cache file to reflect any recent changes.


    # ppdmgr -u | -r [ -R repository ] [ -L label ]
    
    -u

    Updates the PPD cache file with information about the PPD file, or files, that are assigned to the specified label within the specified repository. The default label is user. The default repository is also user. If no changes are identified, no changes are made to the cache file.

    -r

    Removes the existing PPD cache file, then rebuilds the file with the PPD file information for the PPD file, or files, within the specified label.

    If no label is specified, the default label is user, within the specified repository. If a repository is not specified, the default repository is also user.

    Under normal circumstances, you do not need to request a rebuild of the PPD cache file. Use this option only if you suspect that the PPD cache file has become corrupted.

    -R repository

    Specifies a PPD file repository to update. You can specify one of the following PPD file repositories:

    • admin

    • all (Specifies all available PPD file repositories on a system)

    • system

    • user (default)

    • vendor

    -L label

    Specifies a PPD file label.

    The default label is user. Label names must contain characters that are in the portable file name character set. Label names must not begin with a hyphen (-) or contain a semicolon (:). Label names cannot be a reserved label name.

    The following label names are reserved:

    • caches

    • ppdcache

    • manufaliases

    • all

  3. Verify that the PPD file was added by using one of the following methods:

    • Check that the file is displayed in Solaris Print Manager:

      1. Launch Solaris Printer Manager. See How to Start Solaris Print Manager.

      2. Select Modify Printer Attributes (attached or network).

      3. Select the print queue for which you added the PPD file in Step 2 of this procedure.

        If the PPD file that you specified was added successfully, the information is displayed in the Printer Driver field. See Description of the Printer Driver Field in Solaris Print Manager.

    • Use the lpstat command to verify the PPD file was added:


      % lpstat -p printer-name -l
      

      If the PPD file was added to the system successfully, the PPD file name is included in the PPD field of the lpstat command's output.


Example 9–7 Updating the PPD Cache File by Using the ppdmgr Utility

This example shows how to update the PPD cache file to reflect information from the PPD files that are assigned in all the labels within the user repository.


# ppdmgr -u

This example shows how to update the PPD cache file to reflect information from the PPD files that are assigned in the Photos label within the user repository.


# ppdmgr -u -L Photos

This example shows how to update the PPD cache file to reflect the information from the PPD files that are assigned in all the labels within the admin repository.


# ppdmgr -u -R system

This example shows how to update the PPD cache file to reflect information from the PPD files that are assigned in the Photos label within the admin repository.


# ppdmgr -u -L Photos -R admin

Managing the ppd-cache-update Service

The Service Management Facility (SMF) service for updating the PPD cache file, application/print/ppd-cache-update, is run once during system reboot to ensure that modifications made to any PPD file repositories on a system are reflected in the ppdcache file. The service instance is svc:/application/print/ppd-cache-update. This service is enabled by default when you install the Solaris software. To enable or disable the service, use the svcadm command.


Note –

During a software installation or an upgrade, the cache file entries are generated for all PPD files that are delivered to the system repository, /var/lp/ppd. As a result, when the system reboots, it might take longer for the service to make the transition to an online state.


For instructions, see How to Enable or Disable the ppd-cache-update Service. For information about using SMF and the svcadm command, see the smf(5) and svcadm(1M) man pages.

ProcedureHow to Enable or Disable the ppd-cache-update Service

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. To enable or disable the application/print/ppd-cache-update service, type:


    # svcadm enable|disable application/print/ppd-cache-update
    
  3. To verify that the service is enabled or disabled, type:


    % svcs application/print/ppd-cache-update
    

    If the service is enabled, the output is as follows:


    % svcs application/print/ppd-cache-update
    STATE          STIME    FMRI
    online         Apr_26   svc:/application/print/ppd-cache-update:default

    If the service is disabled, the output is as follows:


    % svcs application/print/ppd-cache-update
    STATE          STIME    FMRI
    diabled        Apr_26   svc:/application/print/ppd-cache-update:default
See Also

For step-by-step instructions on using the ppdmgr utility with the -u option to update the PPD cache file, see How to Update or Rebuild the PPD Cache File by Using the ppdmgr Utility.