PrintMaintenance
The Solaris print queue directories can accumulate "dead" print jobs (and other supporting files) that will never leave the queue. Print jobs fail to be processed if they are zero length files, missing relevant (or correct) data, or if they have destination addresses. In extreme cases, the lp service will not start, or will core dump, as the lp commands will stat the spooler directories. Reboot of the server does not clear the spooler, which is intended behavior. Reasons for this accumulation include, but are not limited to:
- the use of third party printer software
- incomplete or interrupted communication between Solaris, remote print servers and network printers
- incomplete or interrupted data streams from applications to Solaris configured printers
This document will outline the "spool clean" (a.k.a. "spool kick") procedure that will stop the print scheduler process (lpsched), remove ALL jobs from the print spooler permantly and rebuild the /var/spool/lp directories. Printer configurations are not removed by this process.
This procedure may be recommended by a Support Engineer to stop the processing of corrupted print jobs. This condition may be the root cause of the printing problem, or it may be necessary to correct the results of a seperate issue. Regardless, it should stabilize the function of the print server. Solution This procedure will permanently remove all print jobs currently in the spooler directories. Choose a time when the print server is less busy, if possible -OR- schedule maintenance time, if necessary.
1. Become root or equivalent on the system.
2. The following commands should clean out the spooler on the system.
First, shut down the print server: # /usr/sbin/svcadm disable print/server (Solaris 10) # /usr/sbin/lpshut (Solaris 9) Test whether lp processes still running, if yes, kill them: # /usr/bin/ps -ef | grep lp # /usr/bin/ps -ef | grep print # /usr/bin/kill <pid> Clean out the LP directory: # cd /var/spool/lp # /usr/bin/rm -r requests tmp temp fifos If print jobs need to be preserved, rename the files or directories (to FILENAME.old) instead. # /usr/bin/rm SCHEDLOCK Note that the SCHEDLOCK file might not exist, which is normal It is ok to remove everything in /var/spool/print, including the hidden files. # /usr/bin/rm -r /var/spool/print If print jobs need to be preserved, rename the directory (to /var/spool/print.old) instead. Restart the scheduler: # /usr/sbin/svcadm enable print/server (Solaris 10) # /usr/lib/lpsched (Solaris 9) Verify the status of your printers # /usr/bin/lpstat -t
NOTE FOR SOLARIS 10: If this procedure is being done to correct a print service FMRI in maintenance, be sure to "clear" the maintenance state after the spool clean is performed and before re-enabling the affected service. The following example demonstrates this for the print/server FMRI that runs lpsched:
It may be necessary to clear the print service if it had previously gone into maintenance: # svcs print/server STATE STIME FMRI maintenance Sep_20 svc:/application/print/server:default # svcadm clear print/server # svcadm enable print/server # svcs print/server STATE STIME FMRI online Sep_20 svc:/application/print/server:default
NOTES
- Any print jobs that exist in the preserved spooler directories /var/spool/lp/tmp.old/*/ consists at least of one control file which has a trailing "-0". Check for the records of "D queuname" and "F filename".
- Any print jobs that exist in the preserved transfer directory /var/spool/print.old will be preceded by a "d" for data file or a "x" for transfer file. Information about the destination printserver and queuename can be obtained in the corresponding transfer file.
- Important print jobs can be submitted as a new print job manually, after the problem is corrected. Use the following command:
# lp -d queuename filename
- Unless the entire procedure is performed as shown, the spooler may not be cleaned and rebuilt properly or at all.
- /usr/lib/lpsched appears to be a binary file on Solaris 8 and Solaris 9, but it is a shell script on Solaris 10. The procedure will still work.