Operating System - HP-UX
1831999 Members
2952 Online
110034 Solutions
New Discussion

Deleting a printer queue without stopping lpsched.

 
SOLVED
Go to solution
jerry1
Super Advisor

Deleting a printer queue without stopping lpsched.

Does anyone know how to delete print spooler queues with hppi, or other, without stopping the lp spooler?

As I understand it. When you shutdown the spooler, lpsched, the queues will still accept print jobs but will stop all print jobs currently printing and resubmit them when lpsched is started back.

I have several hundred queues and it seem strange that I have to stop the scheduler for all the queues just to delete one queue. I read also that if you want to do a move of a job to another queue, lpsched will be shut down also.
5 REPLIES 5
Pete Randall
Outstanding Contributor
Solution

Re: Deleting a printer queue without stopping lpsched.

Jerry,

This has been a thorn in my side forever!! I know of no way to accomplish this without shutting down the spooler. The only way I deal with it as by doing any printer mainenance early, before the users come in and start beating on the system.


Pete

Pete
Jeff Schussele
Honored Contributor

Re: Deleting a printer queue without stopping lpsched.

Hi Jerry,

As Pete stated there are certain lp functions that cannot be accomplished *without* stopping the spooler - this is one of them.

Sorry,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mark Grant
Honored Contributor

Re: Deleting a printer queue without stopping lpsched.

Well actually you can but it's not very nice and may not always work.

You can delete /var/spool/lp/request/

And delete /var/spool/lp/interface(

You can then delete all the other sub-directories that have your printer name. I know it has worked because I did it my mistake once.

I don't think lpsched is too clever and although it has a file containing all the queue names, I think it re-builds it when you next restart it.
Never preceed any demonstration with anything more predictive than "watch this"
Geoff Wild
Honored Contributor

Re: Deleting a printer queue without stopping lpsched.

That's a limitation of the native LP Spooler.

The spooler must be stopped to "cleanly" remove printers...

Moves requests that were queued by lp(1) between LP destinations. This command can be used only when lpsched is not running.


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
A. Clay Stephenson
Acclaimed Contributor

Re: Deleting a printer queue without stopping lpsched.

The native lp spooler is a very old beast. With many printers served from the same host, you might consider using one of the 3rd-party spooler packages. Most of these will serve as drop-in replacements for lp.

Deleting printers in not quite so bad. Generally, you can accomplish this "more or less" using the reject command so that subsequent lp jobs fail upon submission. I would add a "-r" clause so that the users would know this printer will be deleted. You can also use the cancel command to clobber any outstanding print jobs for this printer.
You can now actually delete the printer when a maintenace window can be scheduled.

The far more difficult problem is adding new printers. My trick for that (which is the least evil method I've found over many years) is to intentionally create "spare" printers. These "spares" should be entirely consistant with your naming conventions and thus ready to go into service. The spare queues are fully configured (often as a clone of an actual, existing print queue) but are set to reject with -r "Spare Printer Queue; unavailable for use." as a reason. They are also disabled. Now, when I need to add a printer, I simply modify one of the "spare" printers by replacing the interface file(s) with the real version(s); issue an "accept" command; and finally an "enable" command. All of these can be done while lpsched is running. So finally, getting back to your original question, in most cases, rather than actually deleting the print queue, I issue a reject and disable and this one becomes part of the "spare" pool.
If it ain't broke, I can fix that.