System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: lpadmin: corrupted member file

 
Super Advisor

Re: lpadmin: corrupted member file

So in your opinion what is the best solution in this case?

 

Regards

Acclaimed Contributor

Re: lpadmin: corrupted member file

>what is the best solution in this case?

 

What program are you running to add the printer?

Run tusc on that to see which file it doesn't like:

tusc -fp -ea -o tusc.out your-program ...

Super Advisor

Re: lpadmin: corrupted member file

what do you mean by "What program are you running to add the printer?"

In fact, im trying to add the network printer via SMH -> Printers and Plotters

 

 

Acclaimed Contributor

Re: lpadmin: corrupted member file

>I'm trying to add the network printer via SMH -> Printers and Plotters

 

That's exactly what I mean.  You may what to start up SMH and then use tusc to trace the running PID.

Super Advisor

Re: lpadmin: corrupted member file

Ive just also found that when trying to remove an already existing printer, im getting a similar output as follows:

 

A problem occurred doing "lpadmin -xlp_53". stderr from this command is "/usr/sbin/lpadmin: corrupted member file." Unable to remove printer "lp_53" because of above errors.

 

What do you suggest in this case especially that im given a special authorization to access as root however, im not allowed to install 3rd party tools as "tusc" on this critical platform. Is there an alternative work-around ?

 

Thanks in advance

Acclaimed Contributor

Re: lpadmin: corrupted member file

>I've just also found that when trying to remove an already existing printer

 

That's good, you have a much smaller test case to run from tusc.

 

>I'm not allowed to install 3rd party tools as "tusc" on this critical platform. Is there an alternative work-around?

 

Not really.  tusc is the right tool for the job.

About the only thing you could do is install tusc on another system and then see what files lpadmin tries to open and compare those files on the bad system.  Unfortunately on your working system, you won't know which file is bad or which syscall is going bad.

 

Super Advisor

Re: lpadmin: corrupted member file

Many thanks for your support. Regarding this situation im still searching for a solution without success.

I proceeded to generate the output file from tusc.out as you suggested from a running test server and attached it.

Could you please provide some help/suggestion by taking a look into that file and help to interpret it as i do not have any idea about those HP-UX internals procedures? In your opinion, what are the critical files that need to be replaced in that case?

In addition, suppose that replacing those files didn't work as expected and in the worst case scenario can an OS reinstallation (clean install) be avoided? and suppose that i have a similar server model that is functioning properly with the same applications installed on the same network (different hostname / ip addresses...) can an image of this running server solve this issue by redeploying it to the one having problems? Does this procedure affect file systems on volume groups (vg01 / vg02 ....) having different disks hardware paths and using legacy addressing scheme?

If you were in my place how will you proceed?

 

Regards

Acclaimed Contributor

Re: lpadmin: corrupted member file

>Could you please provide some help/suggestion by taking a look into that file and help to interpret it as i do not have any idea about those HP-UX internals procedures? In your opinion, what are the critical files that need to be replaced in that case?

 

Ok.  Good thinks to look for are execve, open, access, stat and unlink:

grep -e open -e execv -e unlink -e access -e stat output.txt

 

You get something like:

[5689] execve(0x9fffffffffffec30, 0x9ffffffffffff788, 0x9ffffffffffff7a0) [entry]
                              argv[0] @ 0x9ffffffffffff840: "lpadmin"
                              argv[1] @ 0x9ffffffffffff848: "-xlp_53"
[5689] execve("/usr/sbin/lpadmin", 0x9ffffffffffff788, 0x9ffffffffffff7a0) = 0 [32-bit]
...
[5689] open("/var/spool/lp/pstatus", O_RDONLY|O_CREAT|O_NONBLOCK, 0640) = 4
[5689] close(4) .......................................... = 0
[5689] open("/var/spool/lp/qstatus", O_RDONLY|O_CREAT|O_NONBLOCK, 0640) = 4
[5689] close(4) .......................................... = 0
[5689] stat("/etc/lp/member/lp_53", 0x7fffd940) .......... = 0

 

So it look like this maybe the "member" in the error message?


[5689] open("/var/spool/lp/FIFO", O_WRONLY|O_NDELAY, 01200) = 4
[[5689] close(4) .......................................... = 0
[5689] access("/var/spool/lp/SCHEDLOCK", F_OK) ........... = 0
[5689] access("/var/spool/lp/FIFO", F_OK) ................ = 0
[5689] access("/var/spool/lp/CLD_FIFO", F_OK) ............ = 0
[5689] open("/var/spool/lp/qstatus", O_RDONLY|O_CREAT|O_NONBLOCK, 0640) = 4
[5689] close(4) .......................................... = 0
[5689] open("/etc/lp/member/lp_53", O_RDONLY|O_CREAT|O_NONBLOCK, 0640) = 4


[5689] open("/var/spool/lp/outputq", O_RDONLY|O_CREAT|O_NONBLOCK, 0640) = 5
[5689] unlink("/etc/lp/member/lp_53") .................... = 0

Here is "member" again.

 

[5689] close(5) .......................................... = 0
[5689] open("/var/spool/lp/tqstatus", O_RDWR|O_CREAT|O_TRUNC|O_NONBLOCK, 0640) = 5
[5689] open("/var/spool/lp/qstatus", O_RDWR|O_CREAT|O_NONBLOCK, 0640) = 6
[5689] unlink("/var/spool/lp/tqstatus") .................. = 0
[5689] close(6) .......................................... = 0
[5689] close(5) .......................................... = 0
[5689] open("/var/spool/lp/tpstatus", O_RDWR|O_CREAT|O_TRUNC|O_NONBLOCK, 0640) = 5
[5689] open("/var/spool/lp/pstatus", O_RDWR|O_CREAT|O_NONBLOCK, 0640) = 6
[5689] unlink("/var/spool/lp/tpstatus") .................. = 0
[5689] close(6) .......................................... = 0
[5689] close(5) .......................................... = 0

[5690] execve(0x60000000c0238a60, 0x200000007fffcdc0, 0x7ffff804) [entry]
                              argv[2] @ 0x7fffd310: "rm -fr /var/spool/lp/request/lp_53"
[5690] execve("/usr/bin/sh", 0x7fffcdc0, 0x7ffff804) ..... = 0 [32-bit]
[5691] vfork() .........(returning as child ...) ......... = 5690
[5691] execve(0x40024de0, 0x40024e00, 0x40024e80) ........ [entry]
                              argv[0] @ 0x40024e20: "rm"
                              argv[1] @ 0x40024e40: "-fr"
                              argv[2] @ 0x40024e60: "/var/spool/lp/request/lp_53"
...
[5689] unlink("/etc/lp/interface/lp_53") ................. = 0
[5689] unlink("/etc/lp/interface/#lp_53") ................ ERR#2 ENOENT
[5689] unlink("/etc/lp/interface/lp_53#") ................ ERR#2 ENOENT
[5689] unlink("/var/spool/lp/cinterface/lp_53") .......... ERR#2 ENOENT
[5689] unlink("/var/spool/lp/cinterface/#lp_53") ......... ERR#2 ENOENT
[5689] unlink("/var/spool/lp/cinterface/lp_53#") ......... ERR#2 ENOENT
[5689] unlink("/var/spool/lp/sinterface/lp_53") .......... ERR#2 ENOENT
[5689] unlink("/var/spool/lp/sinterface/#lp_53") ......... ERR#2 ENOENT
[5689] unlink("/var/spool/lp/sinterface/lp_53#") ......... ERR#2 ENOENT

[5689] unlink("/etc/lp/member/lp_53") .................... ERR#2 ENOENT

 

Things you could try removing.


[5689] open("/var/spool/lp/FIFO", O_WRONLY|O_NDELAY, 01200) = 4
[5689] close(4) .......................................... = 0
[5689] open("/var/spool/lp/default", O_RDONLY|O_CREAT|O_NONBLOCK, 0640) = 4
[5689] close(4) .......................................... = 0
[5689] open("/var/spool/lp/default", O_WRONLY|O_CREAT|O_TRUNC|O_NONBLOCK, 0640) = 4
[5689] close(4) .......................................... = 0

>suppose that replacing those files didn't work as expected and in the worst case scenario can an OS reinstallation (clean install) be avoided?

 

Sure, you just need to remove your printer config, status files and put it back.

Under SAM, there was a command to save and restore that you could use.  In your case you would have to have a backup, before it went bad.

 

>can an image of this running server solve this issue by redeploying it to the one having problems?

 

Do you have the same printers installed there?

 

>If you were in my place how will you proceed?

 

Install tusc so you can see what files have the errors.

But we do have a relation between the "member" in the error message and a directory:

/etc/lp/member/

 

What are in those files, at least the bad one and one good one?