Certification Objective 8.02Managing Printers


Certification Objective 8.02—Managing Printers

Exam Objective 5.1: Configure and administer Solaris 10 OS print services, including client and server configuration, starting and stopping the LP print service, specifying a destination printer, and using the LP print service.

The Solaris printing software provides an environment for setting up and managing client access to printers on a network by providing a graphical user interface (GUI) tool called Solaris Print Manager, and by providing the LP print service commands.

Understanding the Solaris Print Process

The Solaris print process uses the LP print service, which is a set of software utilities that automate the process of sharing printers to print files. The print process includes print clients and print servers. A print client is a machine that has the print client software installed on it, which enables it to accept print requests from a local user and send them to a remote print server. A print server is a machine with the print server software installed on it that enables it to accept print requests from remote print clients and process them. Any machine with the Solaris system on it and having enough resources, such as disk space, can be connected to a local printer to make it a print server.

Figure 8-2 illustrates the print process starting with a user issuing a print request on a print client and ending with the printed output from a printer.

image from book
Figure 8-2: Overview of the Solaris print process

The steps in this process are listed here:

  1. A user submits a print request from a print client machine by issuing either the SVR4-bascd lp command or the BSD-based lpr command. The user may or may not specify a printer name in the command.

  2. The print command processes the request, for example, it checks a hierarchy of print configuration resources to determine where to send the print request.

  3. The print command sends the print request directly to the appropriate print server. A print server can be any server that accepts the Berkley Software Distribution (BSD) printing protocol, including SVR4 (lp) print servers and BSD lpr-based print servers.

  4. The print server sends the print request to the appropriate printer.

  5. The print request is printed.

Step 2 in the print process needs further explanation. If the user does not specify a printer name (or class), the command does the following:

  1. Checks the values for the user's environment variables PRINTER and LPDEST for the default printer.

  2. If none of these environment variables is defined, it checks the .printers file in the user's home directory for a default printer.

  3. If no default printer alias exists in the .printers file, it checks the print client's /etc/printers.conf file for configuration information.

  4. If the printer is still not found, it checks the name service such as NIS.

On the Job 

Files that belong to the print requests in the queue are stored in the /var/spool/lp directory and stay there until they are printed. You must have enough disk space for this directory, depending on the print load.

A new feature for printing on a network is the Internet Printing Protocol listener, ipp-listener, which works in conjunction with the Apache web server shipped as part of the Solaris software. You can use this feature to print a web page over the Internet. The IPP listener listens on port 631 for print-related HTTP requests and communicates the requests to the printing system. The listener is managed by the Service Management Facility (SMF) under the following FMRI:

    svc:/application/print/ipp-listener 

Now, that you have a view of how the print process works, let's explore how to administer the printers.

Administering Printers

After you set up print servers and print clients in your network, you may need to perform the following administrative tasks frequently:

  • Check the status of printers.

  • Restart the print scheduler.

  • Delete remote printer access.

  • Delete a printer.

Checking Printer Status

Checking the printer status is at the heart of many routine printer administration tasks that require information about the status of the LP print service or a specific printer. For example, you may need to determine which printers are available for use, and you may need to know the characteristics of those printers.

The lpstat is your command to obtain status information about the LP print service or a specific printer offered by the service. The syntax for this command is shown here:

    $ lpstat [-d] [-p <printerName>] [-D] [-l] [-o <list>] [-t] 

The options are listed as follows:

  • -d. Show the system's default printer.

  • -D. Show the description of the printer specified by <printerName>; usually used with other options such as -p.

  • -l. Show the characteristics of the printer specified by <printerName>.

  • -o [<list>]. Display the status of the output requests specified by <list>, which could be an intermix of printer names, class names, and request IDs. If you do not specify a list, the status of all requests is displayed.

  • -p [<printerName>]. Show whether the printer specified by <printerName> 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 in a comma-separated list, or a space-separated list enclosed in quotation marks. If you do not specify a printer, the status of all the printers is displayed.

  • -t. Show the status information about the LP print service. It includes the status of all printers, including whether they are active and whether they are accepting print requests.

So, you can use the lpstat command to determine the status of a print request, a printer, and many other aspects of the print service such as print scheduler.

Starting and Stopping Print Scheduler

The print scheduler daemon, lpsched, handles print requests on print servers. When it is stopped, print requests are neither accepted nor printed. In Solaris 10, the lpadmin command automatically enables the lpsched service when a local printer is added to the system and disables it when the last local printer is removed. However, sometimes you will need to stop the scheduler and to restart a stopped scheduler manually.

On the Job 

If a print request was being printed when the print scheduler stopped, the print request will be printed in its entirety from the beginning when you restart the print scheduler.

To determine whether the print scheduler is running, you can use the following command:

    lpstat -r 

If the print scheduler is not running, the following message is displayed:

    scheduler is not running 

You can start (or restart) the scheduler by using the following command:

    /usr/lib/lpsched 

You can stop the scheduler by using the lpshut command.

Because the print service in Solaris 10 is run under SMF, you can also use the SMF svcs and svcadm commands to manage the print scheduler, which is controlled by the SMF service with FMRI:

    svc:/application/print/server 

image from book
Exam Watch

The LP print service (the lpsched) is automatically started when you add a printer to the system with the lpadmin command.

image from book

Therefore, to find out whether the scheduler is running or not, issue the following command:

    svcs svc:/application/print/server 

To start the print scheduler, issue the following command:

    svcadm enable svc:/application/print/server 

To stop the print scheduler, issue the following command:

    svcadm disable svc:/application/print/server 

To keep track of the print requests, the print scheduler keeps a log of the print requests in the /var/spool/lp/requests/<systemName> and /var/spool/lp/tmp/<systemName> directories, where <systemName> specifies the name of the system. Each print request has two log files: one in each of these two directories. The /var/spool/lp/requests/<systemName> directory is accessible only to the superuser and the lp service, whereas the information in the /var/spool/lp/tmp/<systemName> directory can be accessed by the superuser, the lp service, and the user who submitted the request. Although the print scheduler manages print requests, on occasion you may need to intervene—for example, to cancel a print request.

Knowing and Canceling Print Requests

If you want to cancel a print request, you will need to know the request ID for the request. You can find the request ID by becoming the superuser and issuing the following command:

    #lpstat [-o <list>] [-u <userList>] 

The <list> can specify a list of printer names, class names, or print request IDs. The list may have multiple values in it separated by commas or spaces. If you use spaces, enclose the list in double quotes. If you don't specify <list>, the status of print requests submitted to all printers is displayed.

The <userList> specifies user login names. Use this option to check the status of requests from specific users. The list may have multiple values in it separated by commas or spaces. If you use spaces, enclose the list in double quotes. If you don't specify <userList>, the status of print requests made by all users is displayed.

To cancel a request, you can issue the following command:

    # cancel <requestID> <printerNarae> 

The <requestID> specifies the request ID of a print request that you want to cancel. You can specify multiple request IDs in a comma-separated or space-separated list. If you use spaces, enclose the list in the double quotes.

The <printerName> specifies the printer for which you want to cancel the print requests. You can specify multiple printer names in a comma-separated or space-separated list. If you use spaces, enclose the list in double quotes.

image from book
Exam Watch

You can use the cancel command to cancel both kinds of requests—those that are in the queue and those that are currently being printed.

image from book

Printing is an important and very expensive resource on your system. In addition to using system resources such as disk space, it also consumes printer paper, which can cost your organization a great deal, depending on the print load. Solaris helps here by allowing you to control access to printing. You can perform the access control and many other tasks by configuring the LP print service accordingly.

Configuring the LP Print Service

You can configure the LP print service to accomplish the following:

  • Add printers to the service.

  • Change the configuration of existing printers.

  • Remove printers from the service.

  • Set or change the system's default destination printer.

  • Define alerts for printer faults.

  • Control access to the print service.

  • Mount print wheels.

You can configure the LP print service by using the lpadmin command, which has many forms. The aspects of printer configuration that we will explore in this chapter include adding a new printer, deleting a printer, and controlling access to the print service.

Adding a New Printer

The command to add a new printer or to change the configuration of an existing printer has the following syntax:

    lpadmin -p <printerName> <options> 

This command also starts the print scheduler. When you add a new printer, the <options> must specify at least one of the following three options:

  • -s <systemName> [<printerName>]. Make a remote printer accessible to users on your system.

  • -U <dialInfo>. Allow (not enable) your print service to access a remote printer. The <dialInfo> specifies the phone number for a dial-up connection or a system name for other kinds of connections.

  • -v <deviceName>. Associate a device with the printer. The <deviceName> specifics the full path for the device file.

Note that adding the printer adds the printer information to the print server's configuration files only, and the print clients do not automatically know about the printer. You are required to add the printer information to each print client that wants to use the printer.

image from book
Exam Watch

Distinguish between a printer and the printing device. You can associate the same device with more than one printer.

image from book

As an example of using the -s option in the lpadmin command, if you want to access a remote printer named printerR on a system named systemR and you want it called locally printerL on your system, you would issue the following command:

    lpadmin -p printerL -s systemR!printerR 

When you are adding a new printer, only one of the following three options can be supplied:

  • -e <printer>. Copy the interface program of an existing printer specified by <printer> to be the interface program for the printer being added.

  • -i <interface>. Establish a new interface program for the printer. <interface> specifies the pathname of the new program.

  • -m <model>. Select the model interface program specified by <model>, provided with the LP print service, for the printer.

Once you have added a printer to the service, you can control the client access to it.

Controlling Client Access to Printing

You can control access to printing by disabling access to printing at various levels. For example, you can delete the printer information on a client machine by issuing the following command:

    # lpadmin -x <printerName> 

It will delete the information about the printer specified by <printerName> from the print client's directory: /etc/lp/printers.

You can stop accepting print requests for a printer by issuing the following command on a print server:

    # reject <printerName? 

This will stop accepting requests for the printer specified by <printerName>. You should always issue this command before removing the printer, because it will prevent any new requests from entering the printer's queue. The following command will stop the print requests from printing:

    # disable <printerName> 

Later, when you want to start printing the print requests for that printer, you can issue the same command by replacing the command name disable with enable.

Finally, the following command will delete the printer from the print server:

    # lpadmin -x <printerName> 

It will delete the configuration information for the printer from the print server's directory: /etc/lp/printers.

Access to printing can also be controlled at the user level.

Controlling User Access to Printing

By default, all users have access to a printer. However, you can limit their access by using the following form of the lpadmin command:

    # lpadmin -p <printerName> -u allow:<userList> [deny:<userList>] 

These options are described here:

  • -p <printerName>. Specify the name of the printer to which the allow or deny access list applies.

  • -u allow:<userList>. Specify the user login names to be added to the allow access list. You can specify multiple user names in a comma-separated or space-separated list. If you use space, enclose the list in double quotes.

  • -u deny:<userList>. Specify the user login names to be added to the deny access list. You can specify multiple user names in a comma-separated or space-separated list. If you use space, enclose the list in double quotes.

Table 8-8 provides the valid values for the <userList>.

Table 8-8: Values for the <userList> in the allow or deny files

Value for <userList>

Description

all

or

all!all

All users on all systems

all!<user>

<user>

A user specified by <user> on any system

!all

All users on the local system

None

No user on any system

<system>!all

All users on a system specified by <system>

<system>!<user>

A user specified by <user> on a system specified by <system> only

The users specified in the command are added to the allow or deny list for the printer in one of the following files on the print server:

    /etc/lp/printers/<printerName>/users.allow    /etc/lp/printers/<printerName>/users.deny 

Obviously, the users in the allow file have access to the specified printer, and the users in the deny file do not have access. When determining user access, an empty allow or deny file is equivalent to or does not exist. Having said that, if both allow and deny files exist, the deny file is ignored. The combined effect of allow and deny files on the access is described in Table 8-9.

Table 8-9: The allow and deny access rules

State of Allow and Deny Lists

Access Consequence

Neither allow nor deny file exists.

All users can access the printer.

Either allow, or deny, or both files exist but they are empty.

All users can access the printer.

The value of <userList> for the allow file is all.

All users can access the printer.

The value of <userList> for the deny file is all.

No user except root and lp can access the printer.

Any entry in the allow list.

The deny list will be ignored and the only entries in the allow list will have the access.

Non-empty deny list exists, allow list either does not exist or is empty.

Only the users in the deny list are denied the access to the printer.

You can perform various administrative tasks by configuring the LP print service. The configuration information goes into the files underneath the /etc/lp directory. For example, the following file contains configuration information for an individual printer:

    /etc/lp/printers/<printerName>/configuration 

The configuration files should never be edited directly. Change the configuration only by using the lpadmin command. The lpsched daemon, administers the updates for the configuration files.

Now that you know how to perform printer administration, here are some practical scenarios and their solutions.

SCENARIO & SOLUTION

Which command will you issue to view the description of a printer named Cornell?

lpstat -D -p Cornell

You want to see the status of all print requests received by the LP print service. Which command will you issue?

lpstat -o

You have a list of users in the users.allow file to whom you have given access to a printer. What will you need to do if you want to deny access to another user, bkerry.

Ensure that an entry for bkerry does not exist in the allow file. Because the allow file exists, the deny file will be ignored. Therefore, there is no point in creating the deny file.

In summary, there are five basic functions that the LP print service performs:

  1. Initializing the printer so that the print jobs can be submitted and processed

  2. Administering files and scheduling local print requests

  3. Tracking the status of the print jobs

  4. Filtering files, that is, converting print jobs to the correct format for the destination printer

  5. Delivering alerts about printing problems

The three most important takeaways from this chapter are as follows:

  • You can view the processes on a Solaris system with the ps, pgrep, and prstat commands, and you can control a process by sending it a signal through the kill or pkill command.

  • You can schedule the processes by using the crontab and at commands.

  • You can find the status of the LP print service with the lpstat command, and you can configure it with the lpadmin command.




Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX
Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net