HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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

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

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
Bob E Campbell
Honored Contributor

Re: Find corrupt packages installed on system

Not sure how else you are going to find missing files other than comparing what you have to what you expect.

If you mean the fact that it was in a shell script, it took me 5 minutes to write and can check an entire rx2600 in 2.5 minutes. In fact, it showed me that somebody moved /opt/java6 (I wonder if it was me).

The command "swverify \*" will do the same check and more in about 5 minutes. This is what I would recommend. I do not recommend using it only for missing files, unplanned changes to binaries or permissions is hopefully of interest to someone...

Using "swlist -l fileset -a state |\
grep -e corrupt -e transient"

runs in one second, but will never tell me anything about missing files, just specific types of meta data corruption in IPD data.