Operating System - HP-UX
1825769 Members
1992 Online
109687 Solutions
New Discussion

Re: lpadmin -x<printer> failing

 
Marc Ahrendt
Super Advisor

lpadmin -x<printer> failing

My issue on a K380 running 10.20:
lpshut
lpadmin -xprint101
lpadmin: can't open class file
lpsched
lpstat -t | grep print101
device for print101: /dev/null
print101 accepting requests since Apr 29 15:23
printer print101 is idle. enabled since Apr 29 15:35

My question:
How do I get the system to remove this print queue from the spooler? "sam" gives the same error, and "jetadmin" does no better and only states "Cannot delete print101!". The only extra information I have is that print101 was a memeber of a print class, but that print class has been deleted.
hola
6 REPLIES 6
TTr
Honored Contributor

Re: lpadmin -x<printer> failing

- Ensure that the clas is really deleted with "lpstat -c"
- Check if there are any pending pring jobs on the class or on the printer that you are trying to delete. "lpstat -o" or "ps -fu lp"
Marc Ahrendt
Super Advisor

Re: lpadmin -x<printer> failing

TTr, I tried the following:
"lpstat -c" returns nothing as expected
"lpstat -o" retuns no entries

I am really at a loss since I can print to print101 fine, but just cannot delete as shown in my original post. I had used teh commands below earlier to add print101 to a new class and then later delete the class:
lpshut
lpadmin -pprint101 -g0 -cTestClassPrint
lpadmin -porljfac -g7 -cTestClassPrint
lpsched
...
lpshut
lpadmin -xTestClassPrint
lpsched
hola
TTr
Honored Contributor

Re: lpadmin -x<printer> failing

Something is throwing off lpadmin, maybe a leftover file from the class. Check in the lp directories /etc/lp/interface and more importantly the /var/spool/lp areas and specifically /var/spool/lp/request. Not sure what to look for but you will know when you see it.
Bill Hassell
Honored Contributor

Re: lpadmin -x<printer> failing

The spooler's pstatus file is corrupted. This a binary file so editing it won't work. You'll need to use the famous spoolkick procedure. Essentially, you remove every printer (keeping a record of what they are and how they are connected). Once you have removed as much as possible, you then zero out the 3 status files:

cd /var/spool/lp
cat /dev/null > pstatus
cat /dev/null > qstatus
cat /dev/null > outputqjobs that are in the

Also remove any leftover files and directories in /etc/lp/interface and /etc/lp/class.

Now add a printer and verify normal operation.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: lpadmin -x<printer> failing

>Bill: You'll need to use the famous spoolkick procedure

Would using SAM's save and restore LP config work? Or would it copy the corruption?
Marc Ahrendt
Super Advisor

Re: lpadmin -x<printer> failing

TTr: your approach was somewhat helpful ...but using "ls" to look around never raised any flags for what was wrong

Bill: your approach along with some specifics was more helpful in that it made me believe stronger the all the files were intact but most likley one or more corrupted ...but using your approach was definitely a last resort

Dennis: your approach for using "/usr/sam/lbin/lpmgr" would do as you thought ...simply make a backup copy of a corrupted spooler configuration

In my case as described above there was some "mild" corruption and below was how I resolved it:

lpshut
rm /etc/lp/interface/model.orig/print101 /etc/lp/interface/print101 /etc/lp/member/print101
rmdir /var/spool/lp/request/print101
lpadmin -pprint101 -v/dev/null -mlaserjet
lpadmin -xprint101
lpsched
hola