Contained Within
Find More Documentation
Featured Support Resources
| PDF로 이 문서 다운로드
Routine Printer Administration
4
- This chapter describes how to administer printers after they are set up.
- If you want to skip the background information that explains the concepts of administering printers, and proceed directly to step-by-step instructions, use the following table to find the page where the instructions for a specific task begin.
-
- If you want to review background information first, read "About Routine Printer Administration" on page 100.
- You can refer to the following chapters and appendixes for additional information about printing:
-
- See Chapter 3, "Setting Up Printers," for information about setting up basic printing services using Printer Manager, an Administration Tool application.
- See Chapter 5, "Managing Character Sets, Filters, Forms, and Fonts," for tasks specific to different types of printers.
- See Chapter 6, "Setting Printing Policies," for to set printing policy, such as whether banner pages are required.
- See Chapter 7, "Troubleshooting Printing Problems," if you have trouble setting up or administering printing.
- See Appendix A, "Setting Up Printer Services Using the Command-Line Interface," for information about setting up basic printing services using the LP print service's command-line interface.
- See Appendix B, "Understanding and Customizing the LP Print Service," for a description of the LP print service and how to customize various aspects of it.
About Routine Printer Administration
- This section describes the tasks you will perform repeatedly to support the printing needs of the users in your network. These tasks include:
-
- Obtaining information about printers and print requests
- Managing print requests--canceling, moving, or changing the priorities of print requests; putting print requests on hold; and resuming print requests
- Making printers available to users
- Starting and stopping the LP print service scheduler
- Removing a printer
- Cleaning out log files
- For a quick reference to the commands for routine printer administration, see Table 4-3 on page 124.
Checking the Status of Printers and Print Requests
- Many routine administration tasks you perform for printers require information about the printer and the print requests queued to it. For example, to cancel a print request, you have to know the print request's identification number (ID).
- You use the lpstat command to find out the status of the LP print service. You also can check the status of print jobs in print queues, determine which printers are available for use, and examine the characteristics of those printers.
Managing Print Requests
- While the LP print service is operating on one or more systems, you may have to manipulate the queued print requests. You can cancel, move, hold, or resume print requests, as well as change the priorities of print requests. These actions can help you to keep printing services operating smoothly. For example, if a printer has to be shut down for repairs, you can move the jobs to another printer.
Canceling Print Requests
- Use the cancel command to cancel print requests from printer queues or to cancel jobs that are printing. There are three ways to use the cancel command:
-
- To cancel requests by identification number (ID)
- To cancel requests from a specific user on all, or specified, printers
- To cancel the job currently printing
- Only the user who submitted the request, or someone logged in as root or lp can cancel a print request.
- To cancel a specific request, you need to know its request ID. The request ID always includes the name of the printer, a dash, and the number of the print request. When you submit the print request, the request ID is displayed. If you do not remember the print request ID, you can get it easily by using the lpstat command without any options.
Moving Print Requests
- As an administrator, if you plan to change the way a printer is used, or decide to take a printer out of service, you should have the print service reject additional print requests, and then move or cancel any requests that are currently queued to the printer. The LP print service will try to find alternate printers, if the user has not specified a printer for the job. Requests for a specific printer are not automatically moved. If you do not move them first, the LP print service will cancel them. Use the lpmove command to move such requests.
- When you move requests, their print request IDs are not changed, so users can still find their requests. Requests that have requirements (for example, content type, forms, and so on) that cannot be met by the newly designated printer are not moved.
Changing the Priority of a Print Request
- Once a user has submitted a print request, you can change its priority in the print server queue in the following ways:
-
- You can put any print request on hold that has not finished printing. Putting a request on hold stops it, if it is currently printing, and keeps it from printing until you resume printing it. Other print requests go ahead of the on-hold request.
- You can move any print request to the head of the queue, where it will be the next job eligible for printing. If you want a job to start printing immediately, you can interrupt the job that is currently printing by putting it on hold.
- You can change the priority of a job still waiting to be printed, moving it in the queue so that it is ahead of lower priority requests and behind requests at the same level or at a higher priority.
- See the section, "How to Set Default Priority and Priority Limits for Users" on page 167 in Chapter 6, "Setting Printing Policies," for information about changing user priority limits.
- Users may put their own print requests on hold and resume them, but they may not resume a print request that has been put on hold by the administrator.
Making Printers Available
- You can control the availability of printers in two ways:
-
- By controlling the flow of requests to the print queue
- By controlling the availability of the printer
- After you have set up printers on the network, you may want to change the ability of users to submit jobs to a particular print queue. To do this, you use the accept and reject commands. You also may need to use the disable command to disable a printer for troubleshooting or maintenance, and then use the enable command to put the printer back into service. You can restrict access to the enable and disable commands to root and lp, or give users permission to access these commands. See "Permitting Users to Enable or Disable a Printer" on page 155 for more information.
- When configuring a print server or a print client, you must instruct the LP print service both to accept print requests and to enable the printer to process those requests so that the requests can be printed.
Controlling the Flow of Print Requests to the Queue
- The LP print service either accepts a file for printing and puts it in the print queue, or it rejects the file. If the file is rejected, the print service returns a message to the user who submitted the request, saying that requests are not being accepted for a specific printer. The accept and reject commands control the flow of print requests to the print queue. The reject command stops any further print requests from being added to the queue for the specified printer or printer class. It does not affect print requests that are already in the print queue.
- You can reject requests for several printers or printer classes by using one reject command in which you list the printer names on the same line, separating the names with spaces. You can specify a reason for not accepting requests. The reason will be displayed on the user's system whenever he or she tries to send a file to that printer.
Controlling the Availability of Printers
- The printer is either enabled and capable of printing from the print queue, or it is disabled and does not print any files. When a printer is enabled, it continues to print jobs from the print queue until the queue is empty, even if the LP print service rejects additional files for the print queue.
- The enable and disable commands control whether a printer processes queued requests. You use the enable command when a printer is newly configured, when a printer has been disabled, or when you want to force the LP print service to override a time-delay due to a fault.
- When you use the enable or disable command on a print client, the command only enables or disables the transfer of the print requests from the print client to the print server, because a print client does not have a printer connected to it. You have to run these commands on the print server to have the printer actually stop or start processing print requests. You can use the disable command to temporarily disconnect a print client from any of the printers it is configured to use. The named printer itself is not disabled, and other clients can continue to use it.
Removing a Printer
- When you move a printer from one system to another, rename the printer, or remove it from service, you should remove the old printer definitions from the LP print service on both the print server system and print client systems.
Starting and Stopping the LP Print Service Scheduler
- Printer daemons may fail either on a print server or on a print client, and need to be restarted. You use the /usr/lib/lp/lpsched command to run the print scheduler. When lpsched is not running, no jobs are printed. When lpsched is restarted, it begins handling queued printing requests. Any jobs that were being printed when lpsched was stopped are reprinted in their entirety.
Cleaning Out Log Files
- The lpsched, lpNet, and requests log files in the /var/lp/logs directory grow as information is appended. The LP print service uses a default cron job to clean out the log files. The lp cron job is located in the /var/spool/cron/crontabs file. It periodically moves the contents of the log files. The contents of log are moved to log.1, and the contents of log.1 are moved to log.2. The contents of log.2 are lost (that is, replaced by the former contents of log.1) when log.2 gets overwritten.
Instructions for Performing Routine Printer Administration
- This section provides step-by-step instructions for performing tasks related to routine printer administration. For many tasks, you will find an example of user input and system output after the instructions.
· How to Check the Status of Printers and Print Requests
-
To check the status of printers and print requests: * Type lpstat [option] and press Return. You can obtain different types of printing status information.
- Use the table below to choose the option you want. Items in lists (for example, printer-names) are separated by commas. To indicate all items of the given type, you can substitute all for the list or omit the list.
-
Table 4-1 lpstat
| Option | Description |
| none | Show all current users' print requests. |
| -a [printer-names] | Accept. Show if printers are accepting requests. |
| -c [class-names] | Class. Show classes and their members. |
| -d | Destination. Show the system's default printer. |
| -f | Forms. Show forms. |
| -o [list] | Output. Show status of print requests. list can be printer names, printer class names, or request IDs. |
-
Table 4-1 lpstat
| Option | Description |
| -p [printer-names][-D] [-l] | Printer. Show status of printers.
-D displays the printer description.
-l displays printer's characteristics. |
| -r | Running. Show if the LP scheduler is running. |
| -R request-id | Request. Show position of job in the queue. |
| -s | Status. Show summary of LP print service status. |
| -S | Sets. Show character sets. |
| -t | Total. Show complete status of LP print service (-s option information, plus the acceptance and idle/busy status of all printers). |
| -u [user-list] | User. Show requests by user. |
| -v [printer-names] | Verify. Show device for local printer, or server name for remote printer. |
- See the reference manual page for lpstat(1) for more information.
-
To review the status of requests already printed: 1. Become root or lp.
-
-
Type cd /var/lp/logs and press Return.
-
Look for the request ID in the requests log file. A history of print requests is kept in /var/lp/logs/requests. For a description of the codes that occur at the beginning of each line, see Table B-6 on page 316.
-
# pwd
/var/lp/logs
# tail requests
s 0x1010
= slw2-20, uid 200, gid 200, size 5123, Mon Nov 18 01:24:01 EST
1992
z slw2
C 1
D slw2
|
-
F /etc/motd
P 20
t simple
U irving
s 0x1010
#
|
Examples of Checking the Status of Printers and Print Requests
- The examples in this section show many ways to obtain the information you may need for performing routine printer administration. Each example uses the lpstat command.
-
Checking the Status of the Current User's Print Requests You can use the lpstat command without any options to check the status of all your print jobs (requests). In the following example, on the system terra, one file is queued to the printer luna.
-
terra% lpstat
luna-1 fred 1261 Mar 12 17:34 being filtered
terra%
|
- When used to check the status of print jobs, the lpstat command displays one line for each print job. From left to right, the line shows the request ID, the user, the output size in bytes, the date and time of the request, and variable information about the request, like "being filtered."
-
Checking the Status of Print Requests by Printer You can use the lpstat -o command to check the status of print requests to a specific printer. You can omit the printer name to check the status of all requests to all printers.
-
saturn% lpstat -o slw2
slw2-78 root 1024 Jan 14 09:07
slw2-79 root 1024 Jan 14 09:08
|
-
Checking Available Printers The following example shows how to obtain the status of the print service scheduler, the default printer destination, and a list of the printers (and the print servers they are on) available to your system.
-
saturn% lpstat -s
scheduler is running
system default destination: slw2
device for slw2: /dev/term/a
system for luna: terra
system for ganymede: jupiter
saturn%
|
- This example shows that on saturn the scheduler is running, the default printer is luna, and two network printers are available, one of which is luna.
-
Obtaining All Status Information You can use the lpstat -t command to obtain a complete status of the LP print service. You get all the information shown by the -s option, plus the status of all printers, whether they are accepting requests and are busy, or whether they are idle.
- In the following example, there are no jobs in the print queue. When files are spooled for printing, the status of those print requests is also displayed.
-
saturn% lpstat -t
scheduler is running
system default destination: slw2
device for slw2: /dev/term/a
system for ganymede: jupiter
luna accepting requests since Wed Jan 2 18:20:10 PST 1992
ganymede accepting requests since Mon Mar 4 15:53:47 PST 1992
printer luna is idle. enabled since Wed Jan 2 18:20:22 PST 1992.
available.
printer ganymede is idle. enabled since Mon Mar 4 15:53:44 PST
1992. available.
saturn%
|
-
Obtaining Printer Status You can request printer status information for all printers or individual printers by using the -p option to lpstat. This option shows whether the printer is active or idle, when it was enabled or disabled, and whether it is available to accept print requests. You can request the status for an individual printer by specifying its name; otherwise, all available printers are checked.
- For example, the status for the printer luna might appear as follows:
-
saturn% lpstat -p luna
printer luna is idle. enabled since Wed Jan 2 18:20:22 PST 1992.
available.
saturn%
|
- If the printer had jobs in the print queue, the active job ID would be displayed instead of the "idle" status.
-
Obtaining Printer Characteristics If you want to check all characteristics for a printer, use the -p option with the -l (long) option to lpstat. This command displays a table of all the configuration information that is used by the LP print service for a printer. This command is especially useful for finding the printer type and content type. You can request the characteristics for an individual printer by specifying its name; otherwise, the characteristics of all available printers are displayed.
- The following example is for a remote printer on a SunOS 4.1 server.
-
saturn% lpstat -p ganymede -l
printer ganymede is idle. enabled since Wed Jan 2 18:20:22 PST
1992. available.
Content types: any
Printer types: unknown
Description: remote
Users allowed:
(all)
Forms allowed:
(none)
Banner not required
Character sets:
(none)
Default pitch:
Default page size:
saturn%
|
- The following example is for a local SunOS 5.x printer.
-
saturn% lpstat -p slw2 -l
printer slw2 is idle. enabled since Wed Jan 2 18:20:22 PST 1992.
available.
Content types: postscript
Printer types: PS
Description: local printer - files
Connection: direct
Interface: /usr/lib/lp/model/standard
After fault: continue
Users allowed:
(all)
Forms allowed:
(none)
Banner not required
Character sets:
Default pitch:
Default page size: 80 wide 66 long
saturn%
|
· How to Cancel Print Requests
-
-
(Optional) Type lpstat [option] and press Return. Use this step if you do not know the request IDs of the jobs to cancel. You do not need to use an option to see your own requests. Use -o printer-name to see jobs queued to a printer, or -o all to see all jobs queued to all printers. Use -u username to see jobs belonging to a specific user.
-
Use the cancel command as follows:
* To cancel a list of print requests, type cancel request-ids and press Return. When you use cancel, a message tells you the requests are canceled, and the next job is printed.
-
saturn% cancel luna-3 luna-4
request "luna-3" cancelled
request "luna-4" cancelled
saturn%
|
-
* To cancel all your requests, or requests belonging to other users, type
-
cancel -u user-list [printer-names] and press Return. You must be root or lp to cancel requests of other users. Separate user names with commas, or enclose the list in quotation marks.
-
saturn# cancel -u ignatz luna
request "luna-1" cancelled
request "luna-2" cancelled
request "luna-5" cancelled
saturn#
|
-
* To cancel the job currently printing, type cancel printer-name and press Return. You must be root or lp to cancel a print request that is not your own.
-
saturn% cancel luna
request "luna-3" cancelled
saturn%
|
· How to Accept or Reject Print Requests
- To perform these tasks, you must become root or lp.
-
To set a printer to accept print requests: * Type accept printer- or class-names and press Return. The printer (or class of printer) begins accepting print requests. You can specify several printers or classes by listing the printer names, and separating the names with a space. If you want a print server to accept print requests from a print client, run the accept command on both the print client and the print server.
-
luna# accept luna
destination "luna" now accepting requests
|
-
To set a printer to reject (stop accepting) print requests: * Type reject -r "reason" printer- or class-names and press Return. The printer (or class of printer) stops accepting new requests. You can specify several printers or classes by listing the printer names, and separating the names with a space. The queued requests will continue printing as long as a printer is enabled. You can reject print requests for all users of a printer by typing the reject command on the print server. Alternatively, you can reject print requests for a specific print client or group of print clients by typing the reject command on each of the print clients. If you do not want to specify a reason, omit -r and the reason for rejecting print requests.
-
terra# reject -r "luna is down for repairs" luna
destination "luna" will no longer accept requests
|
· How to Move Print Requests to Another Printer
- You can use the lpmove command to move specific print requests or all print requests from one printer or printer class to another.
-
-
Become root or lp.
-
(Recommended) Type reject -r "reason" printer-name and press Return. You should prevent any further print requests from being sent to the print queue while you are in the process of moving requests to another printer. This step may not be necessary if you are going to move all requests from one printer to another, because, in that case, lpmove automatically stops accepting requests for the first printer. However, by explicitly rejecting requests, you can give users a reason that explains why the printer is not accepting requests.
-
terra# reject -r "luna will be down today for repairs" luna
|
-
-
(Optional) Type lpstat -o printer-name1 and press Return. If you are going to move individual (rather than all) requests, you need to know the request IDs. To move all print requests from one printer (or class of printers) to another, you do not need to know the request IDs. However, it is a good idea to see how many print jobs are affected before you move the jobs.
-
(Optional) Type lpstat -p printer-name2 and press Return. You should check if the destination printer is accepting requests, before moving requests to it.
-
Move specific or all print requests:
* To move individual requests, type lpmove request-id-list printer-name and press Return.
This moves the specified print requests from the original printer to the new destination printer.
-
terra# lpmove luna-10 luna-11 slw2
|
-
Note - If the user has specified a destination of any printer (using the -d any command as an argument to lp), the lpmove destination is changed from any to the name of the printer you specified. You can change the destination back to any by typing lp -i request-id -d any and pressing Return.
-
* To move all requests, type lpmove printer-name1 printer-name2 or lpmove class1 class2 and press Return. This moves all print requests from the first printer or printer class named to the second printer or printer class named. The LP print service also stops accepting requests for the first printer, just as if you ran the command reject printer-name1. If some requests cannot be printed on the new printer, they are left in the queue for the original printer.
-
-
-
After the first printer is ready for use again, type accept printer-name1 and press Return.
-
· How to Change the Priority of a Print Request
-
-
Become root or lp.
-
Type lp -i request-id -q new-priority-level and press Return. The request is repositioned in the queue. You change the priority level from 0, the highest priority, to 39, the lowest priority. The default is 20.
-
saturn% lp -i ganymede-79 -q 1
|
-
Note - You can change the priority of only one print request at a time.
· How to Hold, Resume, or Print a Request Next
- To perform these tasks, you must become root or lp.
-
To put a print request on hold: * Type lp -i request-id -H hold and press Return. The print request is placed on hold until you cancel it or instruct the print service to resume printing the request.
-
saturn% lp -i ganymede-79 -H hold
|
-
To resume a print request: * Type lp -i request-id -H resume and press Return. The print request that was put on hold is placed back in the queue and will be printed according to its priority and placement in the queue. If you put a hold on a print job that is already printing, resume puts the print request at the head of the queue so that it becomes the next request printed.
-
saturn% lp -i ganymede-79 -H resume
|
-
To set the next print request: * Type lp -i request-id -H immediate and press Return. The print request is placed at the head of the queue. If a job is already printing, you can put it on hold to allow the next request to print immediately.
-
saturn% lp -i ganymede-79 -H immediate
|
· How to Enable or Disable a Printer
- To perform these tasks, you must become root or lp.
-
To enable a printer: * Type enable printer-names and press Return. The printer begins processing queued requests. You can list several printer names, separating the names with a space. If you want a print server to process files from a print client, run the enable command on both the print client and the print server.
-
terra# enable luna
printer "luna" enabled
|
-
Note - You can enable or disable individual printers, not classes of printers.
-
To disable a printer: * Type disable [option] printer-names and press Return. The printer stops processing queued requests. You can list several printer names, separating the names with a space. If you want a print client to stop sending requests to a print server, run the disable command (without -c or -W) on the print client.
- Use the following table to choose an option.
-
Table 4-2 disable
| Option | Description |
| none | Disable the printer, saving the current job for reprinting when the printer is re-enabled. |
| -c | Cancel the current job, then disable the printer. The current job is not printed later. |
| -W | Wait until the current job is finished before disabling the printer. |
| -r "reason" | Provide users with a reason why the printer is disabled. The reason is stored and displayed whenever a user checks on the status of the printer (lpstat -p). |
- For example, suppose you want to stop the current job, and save it to print later, and give a reason why the printer is disabled.
-
terra# disable -r "changing the form" luna
terra# lpstat -p luna
printer luna disabled since Mon Mar 2 12:11:31 EST 1992.
available.
changing the form
terra#
|
-
Note - You cannot enable or disable classes of printers. Only individual printers can be enabled or disabled.
- See "Permitting Users to Enable or Disable a Printer" on page 155 for information about who is authorized to use the enable and disable commands. The enable and disable commands, by default, are owned by lp, and may only be run by lp or root.
-
To disconnect a print client from a print server: * On the print client, type disable printer-name -r "comment" and press Return.
- The transfer of files from the print client to the print server is stopped. The printer can still serve other clients. The -W and -c options do not apply.
-
saturn# disable luna -r "luna is down for repairs"
printer "luna" disabled
|
· How to Remove a Printer From Service
- The following steps show you how to use the LP print service commands to remove a printer. Alternatively, you could use the Printer Manager to perform all the steps, except step 4. The Printer Manager's Delete Printer option is the equivalent of lpadmin -x.
-
Information You Need
-
- Print server's superuser password
- Names of printer, server, and clients
-
-
On the system to which the printer is connected, become root or lp.
-
Type reject printer-name and press Return. This prevents any new requests from being queued to the printer, while you are in the process of removing it.
-
Type disable printer-name and press Return. This discontinues printing any requests that may still be in the queue.
-
Type lpmove printer-name1 printer-name2 and press Return. This moves the requests still in the queue to another printer.
-
Type lpadmin -x printer-name and press Return. The configuration information for the printer you specify is removed from the LP configuration files.
-
-
(Optional) Type lpsystem -r client-name1 client-name2... and press Return.
Specify the names of print clients that were using the printer, unless they are still using another printer on this server. This removes the print client names from the /etc/lp/Systems file.
-
On each client, become root or lp.
-
Type lpadmin -x printer-name and press Return. The configuration information for the printer you specify is removed from the LP configuration files.
-
(Optional) Type lpsystem -r server-name and press Return. Specify the name of the print server to which the printer was connected, unless the print client is still using another printer on this server. This removes the print server name from the /etc/lp/Systems file.
Example of Removing a Printer From Service
- In this example, the printer luna on the print server terra is being removed from the print client jupiter.
-
jupiter% su
Password:
jupiter# lpstat -r
scheduler is running
jupiter# lpadmin -x luna
jupiter# lpsystem -r terra
Removed "terra".
jupiter# rlogin terra
Password:
terra%
su
Password:
terra# lpsystem -r jupiter
Removed "jupiter".
|
· How to Start or Stop the Print Service Scheduler
-
To start the print service scheduler: 1. Become root or lp.
-
-
(Optional) Check if the printer is running. To do this, type lpstat -r and press Return.
If the scheduler is not running, the message scheduler is not running is displayed.
-
Type /usr/lib/lp/lpsched and press Return.
-
saturn# /usr/lib/lp/lpsched
Print services started.
|
-
-
If the scheduler does not start:
a. Type ls /var/spool/lp and press Return.
-
saturn# ls /var/spool/lp
SCHEDLOCK bin logs requests temp
admins fifos model system tmp
saturn#
|
-
b. If a SCHEDLOCK file is listed, type rm /var/spool/lp/SCHEDLOCK and press Return.
- The SCHEDLOCK file is removed. (The file /var/spool/lp/SCHEDLOCK is created when the scheduler starts, to make sure that only one copy of lpsched is running. The lpshut command (described on page 138) automatically removes the SCHEDLOCK file. If lpsched is stopped in any other way, you must remove the SCHEDLOCK file before you can restart lpsched.)
-
c. Type /usr/lib/lp/lpsched and press Return. The print service scheduler should start. If the message Print services started does not appear, check the lpsched log in the /var/lp/logs directory for error messages that may explain the problem and point to a solution.
-
-
If the scheduler appears to start, but does not start:
You may get the message Print services started but lpstat -r says the scheduler is not running and its process does not show up with the ps command. In addition, when you try to use any lp command, error messages appear.
a. Check the lpsched log in the /var/lp/logs directory for error messages that may explain the problem and point to a solution. b. If there is no apparent error, look for recent files, like logs, that the scheduler may be getting stuck on.
While the scheduler is starting up, it checks many of the directories and files it uses or creates during normal operation. If there is a problem with one of the files, it may prevent the scheduler from completing its initialization. You may need to remove files recently created by the LP print service, like those in /var/spool/lp/logs.
-

-
c. Delete files that appear troublesome, but first copy them to other file names.
-
d. Type /usr/lib/lp/lpsched and press Return. The scheduler should start.
-
To stop the print scheduler: 1. (Optional) Check if the scheduler needs to be stopped. To do this, type lpstat -r and press Return.
- You may want to check if the scheduler needs to be stopped. When the scheduler is running, the message scheduler is running is displayed.
-
-
Type lpshut and press Return.
-
saturn# lpshut
Print services stopped.
|
-
-
If the scheduler does not stop:
a. Type ls /var/spool/lp and press Return.
-
saturn# ls /var/spool/lp
SCHEDLOCK bin logs requests temp
admins fifos model system tmp
saturn#
|
-
b. If a SCHEDLOCK file is not listed,
-
-
type cd /var/spool/lp;touch SCHEDLOCK; chown lp\
SCHEDLOCK; chmod 664 SCHEDLOCK and press Return.
- The SCHEDLOCK file is created. This file is normally created when the scheduler starts, to make sure that only one copy of lpsched is running. The lpshut command automatically removes the SCHEDLOCK file. If the file is removed in any other way, you must re-create the SCHEDLOCK file before you can stop lpsched.
-
c. Type lpshut and press Return. The print scheduler is stopped.
· How to Monitor and Clean Out Log Files
- The LP print service records a history of print services in three logs located in the /var/lp/logs directory:
-
- To perform the following tasks, you must become root or lp.
-
To monitor the logs: 1. Type cd /var/lp/logs and press Return.
-
-
Type ls -l * and press Return.
-
Use the head and tail commands to look at the oldest and newest information in the files.
-
To change how the log files are cleaned out: 1. Type cd /var/spool/cron/crontabs and press Return. This gets you to the directory where the lp crontab file is located.
-
-
Edit the lp file.
The lp file has entries like the following:
-
# At 03:13am:
# Move each days 'requests' to 'requests.1'.
# If there was an 'requests.1' move it to 'requests.2'.
# If there was an 'requests.2' then it is lost.
#
13 3 * * * cd /var/lp/logs; if [ -f requests ]; \
then if [ -f requests.1 ]; then /bin/mv requests.1 requests.2;\
fi; /usr/bin/cp requests requests.1; >requests; fi
#
|
- The above entry periodically moves the contents of the current log file to log.1, and the contents of log.1 to log.2. The contents of log.1 and log.2 are overwritten. This entry is one line in the lp crontab file, but it is split into several lines here for readability. It cleans up requests at 3:13 a.m. each day, changing the name to requests.1, and moving the previous day's contents to requests.2. This entry is sufficient to keep the old print request records from accumulating in the spooling file system. You may want to condense information in the requests log to produce a report about the use of the LP print service or to help generate accounting information. You can produce a different script that examines the file and extracts information just before the cleanup procedure. See "Log Files" on page 313 for a description of the structure of the requests log.
-
-
Change the entries.
You can change how frequently the logs are cleaned out by changing the last character at the beginning of the entry; use an asterisk (*) for daily, or a zero (0) for once a week on Sundays.
Reference Information for Routine Printer Administration
- This section provides additional information that you may need to understand the concepts of routine printer administration or to perform routine printer administration tasks.
Summary of LP Print Service Commands
-
Table 4-3 lists frequently used LP print service commands. All commands listed in Table 4-3 are either found in or linked to the /usr/lib directory. If you expect to use these commands frequently, consider including the /usr/lib directory in your PATH variable. See "Using the PATH Variable" on page 40 for information about setting the PATH variable. To use these administrative commands (except lpstat), you must be root or lp.
-
Table 4-3
| Task | Command |
| Activate a printer | enable(1) |
| Cancel a print request | cancel(1) |
| Send one or more file(s) to a printer | lp(1) |
| Report the status of the LP print service | lpstat(1) |
| Deactivate one or more printers | disable(1) |
| Permit print requests to be queued for a specific destination | accept(1M) |
| Prevent print requests from being queued for a specific destination | reject
Described on accept(1M) manual page
|
| Set up or change printer configuration | lpadmin(1M) |
| Set up or change filter definitions | lpfilter(1M) |
| Set up or change preprinted forms | lpforms(1M) |
| Mount a form | lpadmin(1M) |
| Move output requests from one destination to another | lpmove
Described on lpsched(1M) manual page
|
| Start the LP print service scheduler | lpsched(1M) |
| Stop the LP print service scheduler | lpshut(1M)
Described on lpsched(1M) manual page
|
| Set or change the default priority and priority limits that can be requested by users of the LP print service | lpusers(1M) |
|
|