Operating System - HP-UX
1821188 Members
3277 Online
109631 Solutions
New Discussion юеВ

Re: Unable to remove print queue

 
SOLVED
Go to solution
so.nimda
Super Advisor

Unable to remove print queue

Hi,

I am doing a cleanup of all the print queue in my system and while I was able to use "removequeue -q" to remove them, there's this one particular one that won't be removed.

I also tried using SAM to remove but still it won't go.

I tried also to use "lpadmin -x" but it's still there.

How do I remove it?

Thanks
18 REPLIES 18
sarfaraj ahmad
Trusted Contributor

Re: Unable to remove print queue

Hi,

have you tried with below command,
# cancel -e

please check the below link for your reference which may be useful to resolve your problem,

http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1285567872843+28353475&threadId=1218672

Thanks.
Hakki Aydin Ucar
Honored Contributor

Re: Unable to remove print queue

Hi,

cancel [id ...] [printer ...] [-a] [-e] [-i] [-uuser]

try manpage of cancel, lp ;
# man cancel
Kevin Lister
Frequent Advisor
Solution

Re: Unable to remove print queue

Howdy,

Folks, I think he is attempting to remove the queue itself and not the message in the queue.

Is that correct?

Did you try to use the -f switch with the removequeue command? The -f switch should force the removal.

Are you getting any error messages? If so can you please post?

thanks,

kev
so.nimda
Super Advisor

Re: Unable to remove print queue

Hi Kevin,

You are right. I am trying to remove the entire queue.

Here's the error :

# lpstat -pPRT6455
lpstat: printer "PRT6455" non-existent

# removequeue -q PRT6455 -f
Could not cancel jobs for PRT6455

# lpadmin -xPRT6455
lpadmin: destination "PRT6455" non-existent

I would like to remove this and recreate (or add) again.

Thanks & regards
Kevin Lister
Frequent Advisor

Re: Unable to remove print queue

Ok. Let's gather a little info.

Is the printer queue you are trying to delete on the server that contains the spool?

Please post the results of the following:

cd /etc/lp
find . -name PRT6455

cd /var/spool/lp
find . -name PRT6455

kev
so.nimda
Super Advisor

Re: Unable to remove print queue

Hi Kevin,

Result as follows :

root [/etc/lp]
# find . -name PRT6455
./interface/PRT6455
./interface/model.orig/PRT6455
./member/PRT6455

root [/var/spool/lp]
# find . -name PRT6455

root [/var/spool/lp]
#

It can be found in "/etc/lp" but not "/var/spool/lp".

Thanks
Kevin Lister
Frequent Advisor

Re: Unable to remove print queue

Ok. So try this first:

cd /var/spool/lp/request
mkdir PRT6455
chown lp:lp PRT6455
chmod 755 PRT6455

/sbin/init.d/lp stop
/sbin/init.d/lp start

You may want to look in /var/adm/syslog/syslog.log for any messages that may come up about the spooler. If no errors then proceed.

Then start SAM. Double-click "Printers and Plotters", then "LP Spooler", then "Printers and Plotters".

Select the line with PR6455 from the list of spoolers.

Click on "Actions" and then click on "Remove".


If that fails to work then you may try the brute force method of removing the files by hand.

Try this if the first method above doesn't help:

/sbin/init.d/lp stop
cd /var/spool/lp/request
rm -r PR6455
cd /etc/lp

rm interface/model.orig/PR6544
rm interface/PR6544
rm member/PR6544

cd /var/sam/lp

rm member/it_laser
rm interface/it_laser
rm interface/model.orig/it_laser

/sbin/init.d/lp start

Let us know how it goes.

kev

PS

Keep in mind that stopping and starting the printer spooler may interrupt someones print job! So, be careful. ;o)

so.nimda
Super Advisor

Re: Unable to remove print queue

Hi Kevin,

Thanks for your patience and detailed reply.

I have tried the first part (SAM -> Actions -> Remove) and the error is :

"Lp destination "PRT6455" does not exist on ."

By brute force, I have removed all files named "PRT6455" in the following directories :
- /var/spool/lp/request/
- /etc/lp/interface/model.orig/
- /etc/lp/interface/
- /etc/lp/member/
- /var/sam/lp/interface/model.orig/
- /var/sam/lp/interface/
- /var/sam/lp/member/
- /var/sam/lp/cinterface/
- /var/sam/lp/sinterface/

Just to confirm that all traces of "PRT6455" has been removed, I do a "find . -name PRT6455 -print", there are no more files found.

But when I go to "SAM->Printers and Plotters->LP Spooler->Printers and Plotters", I can still see "PRT6455".

This printer is stubborn.... :(

Thanks

Kevin Lister
Frequent Advisor

Re: Unable to remove print queue

Hmmm. Do you see an entry for the printer in this file:

/var/sam/lp/lpinfo

If so, remove it!

Let me know. ;o)

kev
so.nimda
Super Advisor

Re: Unable to remove print queue

Hi Kevin,

It's in "/var/sam/lp/lpinfo" and I have removed it.

When I go to SAM, it's still there. And using SAM -> Actions -> Remove, the error is still there :

"Lp destination "PRT6455" does not exist on ."

This printer sure doesn't want to be removed.

Thanks for working with me through this.

Regards
Kevin Lister
Frequent Advisor

Re: Unable to remove print queue

No problem! I'm just sorry that you are having so much trouble with it. I've had similar problems as well.

Have you stopped and restarted the lp daemon since since removing it from the lpinfo file?

kev
so.nimda
Super Advisor

Re: Unable to remove print queue

Hi Kevin,

No luck !

I have stopped the lp daemon, go to SAM -> Actions -> Remove, and the error is still there :

"Lp destination "PRT6455" does not exist on ."

I have also removed the IP address in /etc/hosts when I did the above.

SAM somehow still remembers this entry even though we have removed all traces of it.

Thanks
Dennis Handly
Acclaimed Contributor

Re: Unable to remove print queue

>SAM somehow still remembers this entry even though we have removed all traces of it.

I suppose you could use tusc to track down what SAM is doing and what files it is reading.
Kevin Lister
Frequent Advisor

Re: Unable to remove print queue

That's a great idea. Start up SAM, attach to the process using tusc, and then go through the motions of deleting. Perhaps you can try to re-add it and then delete it.

kev
so.nimda
Super Advisor

Re: Unable to remove print queue

Hi Dennis,

Thanks for the reply.

With my limited UX knowledge, I didn't dare to
attempt using "tusc". =)

Thanks

so.nimda
Super Advisor

Re: Unable to remove print queue

Hi Kevin,

Sorry for the late reply.

I have managed to remove that printer queue. I didn't try "tusc" as I think it's beyond my expertise.

Anyway, all the printer profiles and related files were "manually created" (by copying from a valid printer and renaming it) in all the locations and then using "remove queue" to remove it - and it worked.

Thanks for all your patience and help. =)
Dennis Handly
Acclaimed Contributor

Re: Unable to remove print queue

>I didn't dare to attempt using "tusc". =)

tusc isn't hard to use but you may have trouble limiting or interpreting the info.

tusc -fp -o tusc.out -ea sam ...
Kevin Lister
Frequent Advisor

Re: Unable to remove print queue

That's great news! I suspected that re-adding and then removing may work. I'm so glad you were able to get it done. Take care and thanks for the points!

kev