Operating System - HP-UX
1752574 Members
4657 Online
108788 Solutions
New Discussion юеВ

Re: Find corrupt packages installed on system

 
Vibhor Kumar Agarwal
Esteemed Contributor

Find corrupt packages installed on system

Hi,

I want to find the corrupt packages installed on the system.
With corrupt my limitation is only to missing files.

swverify gives the details. However, it displays package consistency based on size, mtime, missing, and many other parameters.

I want to find the corrupt packages automatically. At the end of swverify it gives a log of swjob, parsing it for missing files does the trick. But this is a manual step.

How can this be obtained automatically.
Thanks
Vibhor Kumar Agarwal
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: Find corrupt packages installed on system

Hi:

> At the end of swverify it gives a log of swjob, parsing it for missing files does the trick. But this is a manual step.

I would hope that corrupt filesets would be a rare exception. They should be if you are following good practices.

What's hard about writing a script to parse the 'swjob' for missing files? I understand that launching it is a "manual step", but again, how often do you expect problems?

Regards!

...JRF...
Vibhor Kumar Agarwal
Esteemed Contributor

Re: Find corrupt packages installed on system

One of our applications failed due to an dependency package which was partially installed (files were missing).

I want to add that logic in the installer which detects if pre-requisites packages are missing some files, issue a warning and exit.

This has to be automatic now, any tips?
Vibhor Kumar Agarwal
Dennis Handly
Acclaimed Contributor

Re: Find corrupt packages installed on system

>One of our applications failed due to an dependency package which was partially installed (files were missing).

I'm not sure how it is possible for swinstall to be missing files.

Perhaps all you need to do is find the "state" of each fileset?
swlist -l fileset -a state \*
You should replace \* by your list of SD products/bundles.
Vibhor Kumar Agarwal
Esteemed Contributor

Re: Find corrupt packages installed on system

I manually deleted a file of the fileset.

swlist -l fileset -a state Test
Test.Test configured

Gives the output as "configured"

though swverify shows errors and on going in the details of swjob, it shows missing file.

What can i conclude with "state" option?
Vibhor Kumar Agarwal
Dennis Handly
Acclaimed Contributor

Re: Find corrupt packages installed on system

>Vibhor: I manually deleted a file of the fileset.

What type of consistency are you looking for? If you have random root attacks on your product, you'll need to do swverify on the whole thing.

I don't think this is worth it.
You may want to have a script that users can run if something totally unexpected happens and that will run swverify and then look at the swjob output or directly from /var/adm/sw/swverify.log.
Vibhor Kumar Agarwal
Esteemed Contributor

Re: Find corrupt packages installed on system

> look at the swjob output or directly from /var/adm/sw/swverify.log.

Okay, can i somehow automatically parse the swjob output that comes after swverfiy. If I can achieve this, i am good to go.
Vibhor Kumar Agarwal
Bob E Campbell
Honored Contributor

Re: Find corrupt packages installed on system

So you only want to find files that SD is supposed to know about, but that are missing? We can do that, but I warn you that the beauty of anything is lost when inspected too closely....

Try the attached script I banged out. I flag the files that SD expects to change. It can take as an argument anything that is swlist-able, but defaults to everything.

Bob
Bob E Campbell
Honored Contributor

Re: Find corrupt packages installed on system

D'Oh! I meant to print the fileset as well. That is left as an exercise for the reader :-)
Vibhor Kumar Agarwal
Esteemed Contributor

Re: Find corrupt packages installed on system

The script lists every file contained in the product and then checks for its existence.

Some of our filesets are pretty large and checking for each of the file will be very time consuming.
Doesn't look an efficient approach to me.
Vibhor Kumar Agarwal