Managing Printers and the Print Scheduler

This section provides instructions for day-to-day tasks you perform to manage printers and the print scheduler.

Deleting Printers and Printer Access

If a printer needs to be replaced or you want to move the printer to a different location, you must delete the printer information from the LP print service before you physically remove it from the print server. You should also make sure that all the current print requests on the printer are printed or moved to another printer to be printed.

Besides deleting the printer information from the print server, you need to delete the information from the print clients or network name service. If you delete a local printer from a print server, you should delete the remote printer entry from the print clients or network name service. If you move a printer to another print server, you need to delete the old remote printer entry from the print clients or network name service. Then, add access to the remote printer in its new location.

For detailed information on how to delete a local printer and a remote printer, see How to Delete a Printer and Remove Printer Access. You can use Solaris Print Manager to delete either type of printer. However, Solaris Print Manager does not enable you to move queued print requests to another printer.

How to Delete a Printer and Remove Printer Access

Use this procedure when you remove a printer from service, and you want to remove the printer access from the print clients. Then, remove the printer information from the print server.

  1. Log in as superuser, lp, or assume an equivalent role on a print client that has access to the printer you want to delete.

  2. Delete information about the printer from the print client.

    print-client# lpadmin -x printer-name
    
    x

    Deletes the specified printer.

    printer-name

    Specifies the name of the printer you want to delete.

    Information for the specified printer is deleted from the print client's /etc/lp/printers directory.

  3. If the print client does not use another printer on the same print server, delete information about the print server from the print client.

    print-client# lpsystem -r print-server
    
    r

    Removes the specified print server.

    print-server

    Specifies the name of the print server you want to delete.

    The print server is deleted from the print client's /etc/lp/Systems file.

    Repeat Step 2 through Step 3 on each print client that has access to the printer.

  4. Log in as superuser, lp, or assume an equivalent role on the print server.

  5. Stop accepting print requests on the printer.

    print-server# reject printer-name
    

    reject printer-name rejects print requests for the specified printer.

    This step prevents any new requests from entering the printer's queue while you are in the process of removing the printer. For a detailed description, see How to Accept or Reject Print Requests for a Printer.

  6. Stop the printer.

    print-server# disable printer-name
    

    This step stops print requests from printing. For a detailed description on how to stop printing, see How to Enable or Disable a Printer.

  7. Move any print requests that are still in the queue to another printer.

    For a detailed description on how to move print requests to another printer, see How to Move Print Requests to Another Printer.

  8. Delete the printer from the print server.

    print-server# lpadmin -x printer-name
    

    Configuration information for the printer is deleted from the print server's /etc/lp/printers directory.

  9. Delete information about the print clients that were using the printer you just deleted, unless they are still using another printer on the print server.

    print-server# lpsystem -r print-client1[,print-client2 ...]
    r

    Removes the specified print client.

    print-client

    Specifies the name of the print client you want to delete from the print server. You can specify multiple print clients in this command. Use a space or a comma to separate print client names. If you use spaces, enclose the list of print clients in quotation marks.

    The specified print clients are deleted from the print server's /etc/lp/Systems file.

  10. Verify that the printer information has been deleted:

    1. Confirm that the printer information has been deleted on the print client.

      print-client$ lpstat -p printer-name -l
      

      In the command output, you should receive an error indicating that the printer does not exist.

    2. Confirm that the printer information has been deleted on the print server.

      print-server$ lpstat -p printer-name -l
      

      In the command output, you should receive an error indicating that the printer does not exist.

Example 4.1. Deleting a Printer and Remote Printer Access

The following example shows how to delete the printer luna from the print client terra and from the print server jupiter. This example also shows how to delete the print client terra from the print server.

terra# lpadmin -x luna
Removed “luna”.
terra# lpstat -p luna -l 
jupiter# lpadmin -x luna
jupiter# lpsystem -r terra
Removed “terra”.
jupiter# lpstat -p luna -l 

Checking Printer Status

Many routine printer administration tasks require information about the status of the LP print service or a specific printer. For example, you can determine which printers are available for use. You can also examine the characteristics of those printers. You can use the lpstat command to find status information about the LP print service or a specific printer.

If a PPD file was used to create or modify a print queue, the specific PPD file is listed in the lpstat output. If a PPD file was not specified when the print queue was created, the PPD entry in the lpstat output is none.

How to Check the Status of Printers

  1. Log in to any system on the network.

  2. Check the status of printers.

    Only the most commonly used options are shown here. For other options, see the lpstat ( 1 ) man page.

    $ lpstat [-d] [-p] printer-name [-D] [-l] [-t]
    d

    Shows the system's default printer.

    p printer-name

    Shows if a printer is active or idle, when the printer was enabled or disabled, and whether the printer is accepting print requests.

    You can specify multiple printer names with this command. Use a space or a comma to separate printer names. If you use spaces, enclose the list of printer names in quotation marks. If you don't specify printer-name, the status of all printers is displayed.

    D

    Shows the description of the specified printer-name.

    l

    Shows the characteristics of the specified printer-name.

    t

    Shows status information about the LP print service, including the status of all printers, such as whether they are active and whether they are accepting print requests.

Example 4.2. Checking the Status of Printers

The following example shows how to display the system's default printer.

$ lpstat -d
system default destination: luna

The following example shows how to display the status of the printer luna.

$ lpstat -p luna
printer luna is idle. enabled since Jul 12 11:17 2001. available.

The following example shows how to display the description of the printers asteroid and luna.

$ lpstat -p "asteroid luna" -D
printer asteroid faulted. enabled since Jan 5 11:35 2004. available.
unable to print: paper misfeed jam

Description: Printer by break room
printer luna is idle. enabled since Jan 5 11:36 2004. available.
Description: Printer by server room.

The following example shows how to display the characteristics of the printer luna.

$ lpstat -p luna -l
printer luna is idle. enabled since Thu Jul 12 15:02:32 PM PDT
        Form mounted: 
        Content types: postscript
        Printer types: PS
        Description:
        Connection: direct
        Interface: /usr/lib/lp/model/standard
				PPD: none
        After fault: continue
        Users allowed:
                (all)
        Forms allowed:
                (none)
        Banner not required
        Character sets:
							 (none)
				Default pitch:
        Default page size: 80 wide 66 long
        Default port settings:

Example 4.3.  lpstat Command Output When Using PPD Files

In this example, the lpstat command output indicates that the print queue was configured by using the PPD file, Mitsubishi-CP50_Color_Printer-cp50.ppd.gz.

# lpstat -l -p paper
printer paper is idle. enabled since Tue 30 Mar 2004 01:48:38 PM PST
			available.
        Form mounted: 
        Content types: any
        Printer types: unknown
        Description: 
        Connection: direct
        Interface: /usr/lib/lp/model/standard_foomatic
        PPD: 
/path/Mitsubishi-CP50_Color_Printer-cp50.ppd.gz
        After fault: continue
        Users allowed:
                (all)
        Forms allowed:
                (none)
        Banner required
        Character sets:
                (none)
        Default pitch:
        Default page size:
        Default port settings# lpstat l p <queue> 

Stopping and Restarting the Print Scheduler

The print scheduler, lpsched, handles print requests on print servers. However, the print scheduler might sometimes stop running on a system, so print requests stop being accepted or printed.

The lpadmin command automatically enables the lpsched service when local printers are added to the system and disables it when the last local printer is removed. The following procedures describe how to stop and restart the print scheduler. If a print request was printing when the print scheduler stopped running, the print request will be printed in its entirety when you restart the print scheduler.

How to Stop the Print Scheduler

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Determine if the print scheduler is running.

    # svcs application/print/server
    

    You can also use the lpstat r command to determine if the print scheduler is running.

    If the print scheduler is not running, the message scheduler is not running is displayed.

  3. If the print scheduler is running, stop it.

    # svcadm disable application/print/server
    

    You can also use the lpshut command to stop the print scheduler.

How to Restart the Print Scheduler

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Determine if the print scheduler is running.

    # svcs application/print/server
    

    You can also use the lpstat r command to determine if the print scheduler is running.

    If the print scheduler is not running, the message scheduler is not running is displayed.

  3. If the print scheduler is not running, start it.

    # svcadm enable application/print/server
    

    You can also use the /usr/lib/lpsched command to start the print scheduler. For more information about the difference between starting the print scheduler by using the /usr/lib/lpsched command or using the svcadm enable application/print server command to start the print scheduler, see Starting the Print Scheduler With Options.

Starting the Print Scheduler With Options

There are two ways to pass options to the print scheduler under the Solaris Management Facility (SMF):

  • Modify option values only for the duration of a call.

    Use the /usr/lib/lpsched command with the appropriate options when you only want to pass options to the print scheduler for the duration of a call. Before setting options, see the lpsched ( 1M ) man page for more information about these default values and reasons to change them.

  • Maintain option values over a system reboot or if the print scheduler is restarted.

    The SMF manifest for the print server contains properties that are utilized by the print server start-up script. These property values are passed on to the print scheduler and represent the options, which are set by using the svccfg command. The properties are as follows:

    • lpsched/num_filters

    • lpsched/num_notifiers

    • lpsched/fd_limit

    • lpsched/reserved_fds

    Any options that are not set with the svccfg command will use the default values that are in the print scheduler. For more information about using the svccfg command, see the svccfg ( 1M ) man page.

How to Set Print Option Values Only for the Duration of a Call

  1. Become superuser, lp, 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. Set option values.

    # /usr/lib/lpsched option value
    
    
    f num_filters

    Specifies the number of concurrent slow filters that can be run on a print server.

    n num_notifiers

    Specifies the number of concurrent notification processes that can run on a print server.

    p fd_limit

    Specifies the file descriptor resource limit for the lpsched process.

    r reserved_fds

    Specifies the number of file descriptors that the scheduler reserves for internal communications under heavy load.

Example 4.4. Setting Option Values Only for the Duration of a Call

This example shows how to set the number of filters to 2. The remaining options will use the defaults that are in the print scheduler.

# /usr/lib/lpsched -f 2

To use the default options that are in the print scheduler, run the /usr/lib/lpsched command without any options.

Note that starting the print scheduler by using the /usr/lib/lpsched command does not utilize the values that are set with the svccfg command.

How to Set Option Values That Remain Over a System Reboot

  1. Become superuser, lp, 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. Set one or all options.

    # svccfg
    svc:> select svc:/application/print/server
    svc:/application/print/server> setprop property = value
    .
    .
    .
    svc:/application/print/server> quit
    

    For each option that you want to set, repeat the setprop property = value command on a separate line.

  3. Verify that the option has been correctly set by displaying the current values of the print server properties.

    # svcprop svc:/application/print/server
    
  4. Restart the print scheduler.

    • If the print scheduler is not running, use the following commands:

      # svcadm refresh svc:/application/print/server
      # svcadm enable svc:/application/print/server
      
    • If the print scheduler is running, use the following commands:

      # svcadm refresh svc:/application/print/server
      # svcadm restart svc:/application/print/server
      

    To determine if the print scheduler is running, run the svcs application/print/server command.

Example 4.5. Setting Option Values That Remain Over a System Reboot

This example shows how to set the number of filters to 1. This option will remain set over a system reboot, or if you restart the print scheduler.

# svccfg
svc:> select svc:/application/print/server
svc:/application/print/server> setprop lpsched/num_filters = count: 1
svc:/application/print/server> quit

This example shows how to set all options.

# svccfg
svc:> select svc:/application/print/server
svc:/application/print/server> setprop lpsched/num_filters = count: 1
svc:/application/print/server> setprop lpsched/num_notifiers = count: 1
svc:/application/print/server> setprop lpsched/fd_limit = count: 4096
svc:/application/print/server> setprop lpsched/reserved_fds = count: 2
svc:/application/print/server> quit

The following is a sample script that sets all options.

#!/bin/ksh

svccfg <<-EOF
select svc:/application/print/server
setprop lpsched/num_filters = count: 1
setprop lpsched/num_notifiers = count: 1
setprop lpsched/fd_limit = count: 4096
setprop lpsched/reserved_fds = count: 2

EOF

Using the RFC-1179 Protocol Listener to Cascade Print Requests

The RFC-1179 protocol listener (in.lpd) is represented by the FMRI, svc:/application/print/rfc1179. By default, this FMRI is dependent on the print scheduler service, svc:/application/print/server, and will only run if the host is running the print scheduler service.

Normally, the RFC-1179 protocol listener is not needed when the print scheduler is not running. However, if the host is used to cascade print requests, the dependency on the print scheduler service should be removed, as shown in the following example. Note that you must become superuser or assume an equivalent role to remove the dependency on the print scheduler service.

# cat <<EOF | svccfg
>			select application/print/rfc1179
>			delpg lpsched
>			end
>			EOF

After you have removed the dependency, run the following command for the changes to take effect immediately:

# svcadm refresh application/print/rfc1179

How to Enable the LP Print Service

The inetd daemon is the SMF restarter process for the LP print service. This daemon is usually started at boot time. The inetd daemon listens for requests for network services that are currently enabled. The svc:/network/lp:default service handles incoming print requests from the network. This procedure describes how to enable or disable this service. Changes made to the service state persist across system reboots.

  1. Check the status of the LP print service.

    $ inetadm | grep lp
    disabled 	disabled	 	svc:/network/lpdefault
  2. Enable the LP print service.

    $ inetadm -e svc:/network/lp:default
    
  3. Check that the service has been enabled.

    $ inetadm | grep lp
    enabled	online		svc:/network/lp:default