Operating System - HP-UX
1827249 Members
2635 Online
109716 Solutions
New Discussion

Re: Getting mad with swinstall

 
SOLVED
Go to solution
maniac
Occasional Advisor

Getting mad with swinstall

Hello,

I have little experience with HP-UX and got puzzled with SD...

I fail to understand why, suddently, swinstall stopped to install some of my own test depots. Even with a very simple and freshly created one, it will fail for some obscure I/O error while the depot archive looks ok.

Looking at the below, I must admit that I haven't got a clue about what is wrong...

Here is some data that may be useful:

# uname -a
HP-UX plague B.11.00 U 9000/778 2014439760 unlimited-user license
# cat esm.psf
product
tag ESM_ICE_SCRIPTS
revision 1.9
title TEST
fileset
tag script
directory ./=/tmp
is_locatable false
file -m0540 -o0 -g0 ice
end
end
# ./mkdepot
+ PATH=/usr/bin:/usr/sbin:/sbin:/usr/sbin
+ export PATH
+ fgrep revision esm.psf
+ set -- revision 1.9
+ swpackage -vv -s esm.psf -d depot @ esm-ice-scripts-1.9.d

======= 08/24/07 12:35:33 UTC BEGIN swpackage SESSION

* Session started for user "root@plague.security.equant.net".

* Source: plague:esm.psf
* Target: plague:esm-ice-scripts-1.9.d
* Software selections:
*


* Beginning Selection Phase.
* Reading the Product Specification File (PSF) "esm.psf".
* Reading the product "ESM_ICE_SCRIPTS" at line 1.
* Reading the fileset "script" at line 6.
* ./ice (/tmp/ice)

* Selection Phase succeeded.


* Beginning Analysis Phase.
NOTE: Repackaging all of the product "ESM_ICE_SCRIPTS". (The same
product version already exists in the target depot.)
NOTE: Repackaging fileset "ESM_ICE_SCRIPTS.script".
NOTE: The estimated free disk space required on filesystem "/home"
is 0 Kbyte blocks. This requirement will leave 8099 Kbyte
blocks of free disk space on the filesystem after the
packaging session completes.
* Analysis Phase succeeded.


* Beginning Package Phase.
* Packaging the product "ESM_ICE_SCRIPTS".
* Packaging the fileset "ESM_ICE_SCRIPTS.script".
* /tmp/ice (20723 bytes)
* Package Phase succeeded.

======= 08/24/07 12:35:34 UTC END swpackage SESSION

+ su root cd esm-ice-scripts-1.9.d; tar cf ../esm-ice-scripts-1.9.depot .
# tar tvf esm-ice-scripts-1.9.depot
rwxr-xr-x 0/3 0 Aug 24 12:25 2007 ./
r-x------ 0/3 0 Aug 24 12:25 2007 ./catalog/
r-x------ 0/3 0 Aug 24 12:35 2007 ./catalog/dfiles/
rw-r--r-- 0/3 138 Aug 24 12:35 2007 ./catalog/dfiles/INFO
rw-r--r-- 0/3 194 Aug 24 12:35 2007 ./catalog/dfiles/INDEX
r--r--r-- 2/2 54 Aug 24 12:25 2007 ./catalog/dfiles/_ACL
r--r--r-- 2/2 54 Aug 24 12:25 2007 ./catalog/dfiles/_PROD_DFLT_ACL
r-------- 0/3 0 Aug 24 12:25 2007 ./catalog/dfiles/_LOCK_FILE
r-------- 0/3 83 Aug 24 12:25 2007 ./catalog/dfiles/_OWNER
r--r--r-- 0/3 0 Aug 24 12:25 2007 ./catalog/swlock
rwxr-xr-x 0/3 0 Aug 24 12:25 2007 ./catalog/ESM_ICE_SCRIPTS/
rwxr-xr-x 0/3 0 Aug 24 12:35 2007 ./catalog/ESM_ICE_SCRIPTS/pfiles/
r--r--r-- 0/3 138 Aug 24 12:35 2007 ./catalog/ESM_ICE_SCRIPTS/pfiles/INFO
r--r--r-- 0/3 222 Aug 24 12:35 2007 ./catalog/ESM_ICE_SCRIPTS/pfiles/INDEX
r--r--r-- 2/2 54 Aug 24 12:25 2007 ./catalog/ESM_ICE_SCRIPTS/pfiles/_ACL
r-------- 0/3 0 Aug 24 12:25 2007 ./catalog/ESM_ICE_SCRIPTS/pfiles/_LOCK_FILE
r-------- 0/3 83 Aug 24 12:25 2007 ./catalog/ESM_ICE_SCRIPTS/pfiles/_OWNER
rwxr-xr-x 0/3 0 Aug 24 12:35 2007 ./catalog/ESM_ICE_SCRIPTS/script/
r--r--r-- 0/3 231 Aug 24 12:35 2007 ./catalog/ESM_ICE_SCRIPTS/script/INFO
r--r--r-- 0/3 172 Aug 24 12:35 2007 ./catalog/ESM_ICE_SCRIPTS/script/INDEX
rw-r--r-- 0/3 588 Aug 24 12:35 2007 ./catalog/INDEX
rw-r--r-- 0/3 4456 Aug 24 12:35 2007 ./swagent.log
r-x------ 0/3 0 Aug 24 12:35 2007 ./ESM_ICE_SCRIPTS/
r-xr-x--x 0/0 0 Aug 24 12:35 2007 ./ESM_ICE_SCRIPTS/script/
r-xr-x--x 0/0 0 Aug 24 12:35 2007 ./ESM_ICE_SCRIPTS/script/tmp/
r-xr----- 0/0 20723 Aug 22 13:02 2007 ./ESM_ICE_SCRIPTS/script/tmp/ice
# swinstall -s `pwd`/esm-ice-scripts-1.9.depot \*

======= 08/24/07 12:36:32 UTC BEGIN swinstall SESSION
(non-interactive)

* Session started for user "root@plague".

* Beginning Selection
* Target connection succeeded for "plague:/".
ERROR: "plague:/home/cg/esm-1.9/esm-ice-scripts-1.9.depot": An I/O
error occurred while performing this task.
* Source connection failed for
"plague:/home/cg/esm-1.9/esm-ice-scripts-1.9.depot".
WARNING: More information may be found in the daemon logfile on this
target (default location is plague:/var/adm/sw/swagentd.log).
* Selection had errors.



======= 08/24/07 12:36:36 UTC END swinstall SESSION (non-interactive


And the tail of swagentd.log

* Started install agent on "/" for
root@plague.dotcom.net, pid=2748, 08/24/07 12:36:32
UTC
* Started source agent on
"/home/cg/esm-1.9/esm-ice-scripts-1.9.depot" for
root@plague.dotcom.net, pid=2751, 08/24/07 12:36:36
UTC
ERROR: The INDEX file on the source did not exist or could not be
read.
ERROR: The target "/home/cg/esm-1.9/esm-ice-scripts-1.9.depot" could
not be opened. pid=2751 08/24/07 12:36:36 UTC
* Agent pid=2751 completed. 08/24/07 12:36:36 UTC
* Agent pid=2748 completed. 08/24/07 12:36:36 UTC



If someone does have some idea or hint, it would be GREAT. Thanks !
12 REPLIES 12
Aussan
Respected Contributor

Re: Getting mad with swinstall

Maniac
insted of pwd use the full path

try
swinstall -s /home/cg/esm-1.9/esm-ice-scripts-1.9.depot


The tongue weighs practically nothing, but so few people can hold it
maniac
Occasional Advisor

Re: Getting mad with swinstall

Aussan, thanks for your suggestion.

I already did it a while ago but it ends in the same issue. This is really puzzling and swagentd logs are helpless...

I wonder if I'd better remove PHCO_34568 and see how it works ?
Aussan
Respected Contributor

Re: Getting mad with swinstall

Maniac

restart your swagentd

/usr/sbin/swagentd -r

then run the swinstall again
The tongue weighs practically nothing, but so few people can hold it
maniac
Occasional Advisor

Re: Getting mad with swinstall

Wow... Near real time here ! This forum is amazing :-)

Well, restarting swagentd or reboot the system doesn't change anything.

I believe I will remove recently applied patches and perform checks. Here, it is near to completion of business. I'll do that on monday and keep the forum posted.

Many thanks for your help !
Srimalik
Valued Contributor

Re: Getting mad with swinstall

try this:

Extract the depot
tar -xvf esm-ice-scripts-1.9.depot

Then use swinstall to install

swinstall -s /home/cg/esm-1.9/
Sri
abandon all hope, ye who enter here..
Joelmel Roche
Valued Contributor

Re: Getting mad with swinstall

Hi,

Please try check the swinstall I/O error is occurring because the /other_filesystem directory
is NFS mounted. If you unmount it, you should experience these
problems any longer.
maniac
Occasional Advisor

Re: Getting mad with swinstall

Issue ***SOLVED*** !

You won't believe it:

if the depot is a TAR archive and the first file of the archive is not "catalog/INDEX" then all SD software will abort issuing an error message about some non-existent I/O error. Stunning...

One advice to newcomers in the fabulous world of HP-UX depot: DO MANAGE to have this file in the first record of the TAR archive or everything will break and you will WASTE a LOT OF TIME trying to guess what's wrong !!!

Many thanks to all of you who tried to help !


And now, the proof of concept ;-))

# ls -R
ESM_ICE_SCRIPTS catalog swagent.log

./ESM_ICE_SCRIPTS:
script

./ESM_ICE_SCRIPTS/script:
tmp

./ESM_ICE_SCRIPTS/script/tmp:
ice

./catalog:
ESM_ICE_SCRIPTS INDEX dfiles swlock

./catalog/ESM_ICE_SCRIPTS:
pfiles script

./catalog/ESM_ICE_SCRIPTS/pfiles:
INDEX INFO _ACL _LOCK_FILE _OWNER

./catalog/ESM_ICE_SCRIPTS/script:
INDEX INFO

./catalog/dfiles:
INDEX _ACL _OWNER
INFO _LOCK_FILE _PROD_DFLT_ACL

# tar cf ../esm-ice-scripts-1.9.depot *
# tar tf ../esm-ice-scripts-1.9.depot|head -3
ESM_ICE_SCRIPTS/
ESM_ICE_SCRIPTS/script/
ESM_ICE_SCRIPTS/script/tmp/
# swlist -s `pwd`/../esm-ice-scripts-1.9.depot
# Initializing...
# Contacting target "plague"...
ERROR: The INDEX file on the source did not exist or could not be
read.
ERROR:
"plague:/home/cg/esm-1.9/esm-ice-scripts-1.9.d/../esm-ice-scripts-1.9.depot":
An I/O error occurred while performing this task.

# tar cf ../esm-ice-scripts-1.9.depot catalog/INDEX *
# tar tf ../esm-ice-scripts-1.9.depot|head -3
catalog/INDEX
ESM_ICE_SCRIPTS/
ESM_ICE_SCRIPTS/script/
# swlist -s `pwd`/../esm-ice-scripts-1.9.depot
# Initializing...
# Contacting target "plague"...
#
# Target: plague:/home/cg/esm-1.9/esm-ice-scripts-1.9.d/../esm-ice-scripts-1.9.depot
#

#
# No Bundle(s) on plague:/home/cg/esm-1.9/esm-ice-scripts-1.9.d/../esm-ice-scripts-1.9.depot
# Product(s):
#

ESM_ICE_SCRIPTS 1.9 TEST
#
John Payne_2
Honored Contributor
Solution

Re: Getting mad with swinstall

Maniac,

HP has a free tool called Software Package Builder, http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=SwPkgBuilder , which will allow you to create the same psf file, but will do the bundling for you. Additionally, it will validate the psf for you to ensure it will install properly. (If you are going to be doing this sort of things a lot, it could save you some time.)

There are lots of other things you can do with the thing, and it will allow you to do all the things that the SD tool can do. (superceeding, postinstall scripts, versioning, everything...)

Hope it helps
John
Spoon!!!!
Dennis Handly
Acclaimed Contributor

Re: Getting mad with swinstall

>I have little experience with HP-UX and got puzzled with SD.

I assume you have read:
http://docs.hp.com/en/5992-2146/index.html

Nobody has answered your question except John where he says to use a simpler tool, Software Package Builder.

Basically you are using the wrong tool. Do NOT use tar(1). You can use it to look but not touch.

1) Create a depot from bits: swpackage
2) Copy depot to directory depot: swcopy
3) Install a depot: swinstall
4) List a depot: swlist
5) Copy a depot to a tape depot: swpackage
6) While it appears you can also use swpackage to do 2, you should refuse to use SD commands and options that offer you a second inconsistent/confusing way to do things. (And that is -s for source and @ for target, with a few exceptions.)

Your problem is that you used tar -cf instead of 5:

Starting in your directory where you did swpackage. (You could skip creating the directory depot and go directly to tape. Also leave off your obsolete "-d depot" on your swpackage. See complaint on 6) above.)

# swpackage -x media_type=tape -s $PWD/esm-ice-scripts-1.9.d @ $PWD/esm-ice-scripts-1.9.depot

>Aussan: instead of pwd use the full path

Why would want to do something that is harder? The correct statement to maniac is to use $PWD instead of either `pwd` or $(pwd).

# swinstall -s /home/cg/esm-1.9/esm-ice-scripts-1.9.depot

Yes, this works. You might want to add \* to the end to install everything.

>I wonder if I'd better remove PHCO_34568 and see how it works?

No, nothing wrong with SD.

>if the depot is a TAR archive and the first file of the archive is not "catalog/INDEX" then all SD software will abort... Stunning...

Not really, don't use tar. Don't try to look behind the green curtain or under the SD hood. ;-)

>Srikrishan:
>Extract the depot
tar -xvf esm-ice-scripts-1.9.depot

>Then use swinstall to install
swinstall -s /home/cg/esm-1.9/

Do NOT do this. While it may work, and workaround maniac's mistake, the proper command is:
# swinstall -s $PWD/esm-ice-scripts-1.9.depot \*
maniac
Occasional Advisor

Re: Getting mad with swinstall

Denis, John, many thanks for your valuable asnwers. I got your points.

Denis:
> I assume you have read:
> http://docs.hp.com/en/5992-2146/index.html

Nope, in fact I glanced at document B2355-90154 (Managing HP-UX software with SD-UX)
I will read thoroughly the one you mention.

> Yes, this works. You might want to add \* to the end to install everything.

I fully agree with you. It was just in order to perform the tests.

> Not really, don't use tar. Don't try to look behind the green curtain
> or under the SD hood. ;-)

My old and bad habits, I often try to go straight and then I face "oddities" ;-)

Well, this forum rocks ! Next time, I will RTFM before disturbing you.
Thread closed
maniac
Occasional Advisor

Re: Getting mad with swinstall

Solution given by John and Denis.
Dennis Handly
Acclaimed Contributor

Re: Getting mad with swinstall

>Next time, I will RTM before disturbing you.

Don't worry about that. That document is awfully complex and seems to have multiple ways of doing things. (And not in a good way. ;-)
Don't be afraid to ask for pointers after you look at the man pages and the manual.