Operating System - HP-UX
1843580 Members
2394 Online
110221 Solutions
New Discussion

help! /var/spool/lp dir deleted

 
Christopher_23
New Member

help! /var/spool/lp dir deleted

in an effort to clear some disk space the /var/spool/lp directory was apparently accidentally deleted. I have thus far been unable to restore from the backups. Everything seems to run, but when trying to print the user gets an error stating "no such printer or class" what file is missing? I think it would be the spooler file but SAM will not let me restore it.. I am really stuck any help greatly appreciated.
15 REPLIES 15
Steven E. Protter
Exalted Contributor

Re: help! /var/spool/lp dir deleted

You MIGHT get away with creating a tar file on another system, ftp'ing it to the one you messed up and then untarring it.

cd /var/spool
tar cvf /tmp/lp.tar lp

ftp it other server

mv it to /var/spool

tar xvf lp.tar

Next question: When was your last Ignite make_tape_recovery backup? That will restore just fine.

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Michael Tully
Honored Contributor

Re: help! /var/spool/lp dir deleted

If you don't have a backup, then you could get the info from another system. One further suggestion is that most of the files contained in this directory as symbolic links. Check the output from mine.

total 0
lrwxrwxrwt 1 root sys 14 Jan 10 2002 Tclass -> /etc/lp/Tclass
lrwxrwxrwt 1 root sys 15 Jan 10 2002 Tmember -> /etc/lp/Tmember
lrwxrwxrwt 1 root sys 18 Jan 10 2002 cinterface -> /etc/lp/cinterface
lrwxrwxrwt 1 root sys 13 Jan 10 2002 class -> /etc/lp/class
lr-xr-xr-t 1 root sys 18 Jan 10 2002 cmodel -> /usr/lib/lp/cmodel
lr-xr-xr-t 1 root sys 17 Jan 10 2002 fonts -> /usr/lib/lp/fonts
lrwxrwxrwt 1 root sys 12 Jan 10 2002 info -> /etc/lp/info
lrwxrwxrwt 1 root sys 17 Jan 10 2002 interface -> /etc/lp/interface
lrwxrwxrwt 1 root sys 15 Jan 10 2002 log -> /var/adm/lp/log
lrwxrwxrwt 1 root sys 21 Jan 10 2002 lpana.log -> /var/adm/lp/lpana.log
lrwxrwxrwt 1 root sys 19 Jan 10 2002 lpd.log -> /var/adm/lp/lpd.log
lrwxrwxrwt 1 root sys 14 Jan 10 2002 member -> /etc/lp/member
lr-xr-xr-t 1 root sys 17 Jan 10 2002 model -> /usr/lib/lp/model
-rw-r--r-- 1 lp sys 0 Mar 5 2002 outputq
-rw-r--r-- 1 lp lp 0 Jan 10 2002 pstatus
-rw-r--r-- 1 lp lp 0 Jan 10 2002 qstatus
drwxr-xr-x 2 lp bin 96 Jan 10 2002 receive
drwxr-xr-x 3 lp bin 96 Jan 10 2002 request
lrwxrwxrwt 1 root sys 18 Jan 10 2002 sinterface -> /etc/lp/sinterface
lr-xr-xr-t 1 root sys 18 Jan 10 2002 smodel -> /usr/lib/lp/smodel

The request directory has a sub-directory called "PDrequest" which is empty

HTH
Michael
Anyone for a Mutiny ?
Jeff Schussele
Honored Contributor

Re: help! /var/spool/lp dir deleted

Hi Christopher,

Here the listing from my 11.0 /var/spool/lp dir

$ cd /var/spool/lp
$ ll
total 0
lrwxrwxrwt 1 root sys 14 Mar 9 2002 Tclass -> /etc/lp/Tclass
lrwxrwxrwt 1 root sys 15 Mar 9 2002 Tmember -> /etc/lp/Tmember
lrwxrwxrwt 1 root sys 18 Mar 9 2002 cinterface -> /etc/lp/cinterface
lrwxrwxrwt 1 root sys 13 Mar 9 2002 class -> /etc/lp/class
lr-xr-xr-t 1 root sys 18 Mar 9 2002 cmodel -> /usr/lib/lp/cmodel
lr-xr-xr-t 1 root sys 17 Mar 9 2002 fonts -> /usr/lib/lp/fonts
lrwxrwxrwt 1 root sys 12 Mar 9 2002 info -> /etc/lp/info
lrwxrwxrwt 1 root sys 17 Mar 9 2002 interface -> /etc/lp/interface
lrwxrwxrwt 1 root sys 15 Mar 9 2002 log -> /var/adm/lp/log
lrwxrwxrwt 1 root sys 21 Mar 9 2002 lpana.log -> /var/adm/lp/lpana.log
lrwxrwxrwt 1 root sys 19 Mar 9 2002 lpd.log -> /var/adm/lp/lpd.log
lrwxrwxrwt 1 root sys 14 Mar 9 2002 member -> /etc/lp/member
lr-xr-xr-t 1 root sys 17 Mar 9 2002 model -> /usr/lib/lp/model
-rw-r--r-- 1 lp 1000 0 May 21 2002 outputq
-rw-r--r-- 1 lp lp 0 Mar 9 2002 pstatus
-rw-r--r-- 1 lp lp 0 Mar 9 2002 qstatus
drwxr-xr-x 2 lp bin 96 Mar 9 2002 receive
drwxr-xr-x 3 lp bin 96 Mar 9 2002 request
lrwxrwxrwt 1 root sys 18 Mar 9 2002 sinterface -> /etc/lp/sinterface
lr-xr-xr-t 1 root sys 18 Mar 9 2002 smodel -> /usr/lib/lp/smodel
$

As you can see it has a lot on links that can easily be recreated, the q & status files can be recreated with a touch command. But the request dir has to have entries for each defined printer.

If you have a make_recovery tape - that would make life easier. Can get this back using the following

1) Insert tape
2) #mt rew #rewind the tape
3) #mt fsf 1 #move a file space forward
4) tar xvf /dev/rmt/0mn var/spool/lp/* #extract that dir from the tape.

Good Luck,
Jeff

Good Luck
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Paul Sperry
Honored Contributor

Re: help! /var/spool/lp dir deleted

here is my ll of lp

I'd try getting it from another system.

Good luck

# cd lp
# ll
total 60
prw------- 1 lp lp 0 Jan 8 14:03 CLD_FIFO
prw------- 1 lp lp 0 Jan 8 14:03 FIFO
-rw-r----- 1 lp lp 0 Jan 8 14:03 SCHEDLOCK
lrwxrwxrwt 1 root sys 14 Jul 21 2003 Tclass -> /etc/lp/Tclass
lrwxrwxrwt 1 root sys 15 Jul 21 2003 Tmember -> /etc/lp/Tmember
lrwxrwxrwt 1 root sys 18 Jul 21 2003 cinterface -> /etc/lp/cinterface
lrwxrwxrwt 1 root sys 13 Jul 21 2003 class -> /etc/lp/class
lr-xr-xr-t 1 root sys 18 Jul 21 2003 cmodel -> /usr/lib/lp/cmodel
lr-xr-xr-t 1 root sys 17 Jul 21 2003 fonts -> /usr/lib/lp/fonts
lrwxrwxrwt 1 root sys 12 Jul 21 2003 info -> /etc/lp/info
lrwxrwxrwt 1 root sys 17 Jul 21 2003 interface -> /etc/lp/interface
lrwxrwxrwt 1 root sys 15 Jul 21 2003 log -> /var/adm/lp/log
lrwxrwxrwt 1 root sys 21 Jul 21 2003 lpana.log -> /var/adm/lp/lpana.log
lrwxrwxrwt 1 root sys 19 Jul 21 2003 lpd.log -> /var/adm/lp/lpd.log
lrwxrwxrwt 1 root sys 14 Jul 21 2003 member -> /etc/lp/member
lr-xr-xr-t 1 root sys 17 Jul 21 2003 model -> /usr/lib/lp/model
-rw-r--r-- 1 lp sys 5312 Oct 31 13:54 outputq
-rw-r--r-- 1 lp lp 16632 Oct 31 13:54 pstatus
-rw-r--r-- 1 lp lp 4136 Oct 30 11:19 qstatus
drwxr-xr-x 2 lp bin 96 Jul 20 2003 receive
drwxr-xr-x 25 lp bin 1024 Oct 30 11:19 request
-rw-r--r-- 1 lp lp 2 Oct 31 13:54 seqfile
lrwxrwxrwt 1 root sys 18 Jul 21 2003 sinterface -> /etc/lp/sinterface
lr-xr-xr-t 1 root sys 18 Jul 21 2003 smodel -> /usr/lib/lp/smodel
Chris Vail
Honored Contributor

Re: help! /var/spool/lp dir deleted

Here's a list of my /var/spool/lp directory; you'll need to modify it to match your printer structure.

Tclass -> /etc/lp/Tclass
Tmember -> /etc/lp/Tmember
cinterface -> /etc/lp/cinterface
class -> /etc/lp/class
cmodel -> /usr/lib/lp/cmodel
fonts -> /usr/lib/lp/fonts
info -> /etc/lp/info
interface -> /etc/lp/interface
log -> /var/adm/lp/log
lpana.log -> /var/adm/lp/lpana.l
lpd.log -> /var/adm/lp/lpd.log
member -> /etc/lp/member
model -> /usr/lib/lp/model
sinterface -> /etc/lp/sinterface
smodel -> /usr/lib/lp/smodel

The pstatus and qstatus files should be created by the lp spooler. If not, create these with touch, and chown lp:bin, then chmod 644.

Next create the receive and request directories, again chown lib:bin, then chmod 755.

Good Luck
Chris
Kim Doty
Advisor

Re: help! /var/spool/lp dir deleted

I recently got the same messages just by deleting the /var/spool/lp/pstatus file. I went into jetadmin and deleted the spool queue name and readded them and all was fixed. It was actually faster than restoring from backup as this was our development box with only 5 printers set up.
Kim
Frank Slootweg
Honored Contributor

Re: help! /var/spool/lp dir deleted

What error do you get when you try to "Restore Spooler Configuration" with SAM?

Does SAM list any printers which you can select to restore, i.e. Name/Type/Location?
Christopher_23
New Member

Re: help! /var/spool/lp dir deleted

Thanks all, still working on the problem this morning. SAM says "there is no saved print spooler configuarion the file /var/sam/lp/lpinfo does not exist. Unless you have reason to suspect the current print spooler configuration is corrupt"

I inherited the care and feeding of this box, and have never really poked around in it too much. The former admin used CPIO to do backups but it complains about being out of sync and then core dumps when i try: cpio -icv < /dev/rmt/0m

there aren't that many printers on this box, and I wouldn't mind re-creating them, but when i try to do so via SAM the new printers show up, but I cannot enable them. I don't have jetadmin intstalled, maybe that is worth a look? I appreciate the directory listings, I think I might try to recreate the contents.
Robert-Jan Goossens
Honored Contributor

Re: help! /var/spool/lp dir deleted

If I may add something,

Sam Save printer Spooler Configuration and Restore it again. sounds a bit strange but sam can resole/restore a lot file this way, try it.

Robert-Jan.
T. M. Louah
Esteemed Contributor

Re: help! /var/spool/lp dir deleted

Excellent answers !
Little learning is dangerous!
Jose Mosquera
Honored Contributor

Re: help! /var/spool/lp dir deleted

Hi,

If you have a saved copy of your last working spool configuration (SAM/Printers and Plotters/LP Spooler/Save-Restore Spooler Configuration) you just need run de following command:

/usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp

After run this, your last spool configuration commonly saved in "/var/sam/lp" will be retored entirely into /var/spool/lp dir.


Rgds.
V. Nyga
Honored Contributor

Re: help! /var/spool/lp dir deleted

Hi Christopher,

have you solved your problem?
You have not closed your thread (by giving points).
Check if the linked files under /etc/lp and /usr/lib/lp still exists.

Regards
Volkmar
*** Say 'Thanks' with Kudos ***
Wilfred Chau_1
Respected Contributor

Re: help! /var/spool/lp dir deleted

Check your last make_recovery type and it should have backup /var/spool/lp.

Go look at /var/opt/ignite/logs/makrec*

Then, insert the tape, do the following 2 steps, (make sure to use an non-rewind device first)

mt -t /dev/rmt/0mn fsf 1

then use the regular tar commands to extract the dir.

tar -xvf /dev/rmt/0m dir
Christopher_23
New Member

Re: help! /var/spool/lp dir deleted

thanks all for the fast responses, I was able to repair the system by a combination of backing up and restoring the current spool file and then recreating the printers. I am now going to dig into fixing the tape backups.
Sorry I left this open so long.

As an aside, this forum is amazing. I had no idea how helpful it and it members would be.
Jose Mosquera
Honored Contributor

Re: help! /var/spool/lp dir deleted

Hi Chris,

Pls show us your satisfaction with some points, the guys have dedicated time to help you..!

Best Regards