Problem
You have jobs stuck in the print queue. You want to clear the queues and remove all jobs.
Solution
You have to stop all processes and remove the files from spooling directories.
Probably worth taking a backup of these files first. 🙂 All at own risk.
Example
1.
stopsrc -cs qdaemon # bring down qdaemon and clear qdforks.
stopsrc -s lpd
2.
rm /etc/qconfig.bin # compiled /etc/qconfig
3.
rm /var/spool/lpd/qdir/* # queue requests; JDF
4.
rm /var/spool/lpd/stat/* # info on status of devices
5.
rm /var/spool/lpd/pio/msg* # error message files.
6.
rm /var/spool/qdaemon # temp copies of queue jobs
7.
rm /var/spool/lpd/* # temp copies of remote jobs
8.
ps -ef | grep pio # kill any of these processes; look for piobe, pioformat, pioout
9.
ps -ef | grep qd # kill any of these processes; look for qdforks.
10.
startsrc -s qdaemon # restarting qdaemon
startsrc -s lpd # restarting lpd
11.
lssrc -s qdaemon #look for active
ps -ef | grep qdaemon
lssrc -s lpd # look for active
ps -ef | grep lpd
12.
ps -ef | grep srcmstr # if there are 2 running, kill -9 one of them with higher PID.
13.
As a last resort – reboot
Reference
[tags], Unix Coding School[/tags]