Operating System - HP-UX
1832541 Members
4510 Online
110043 Solutions
New Discussion

Re: What's the purpose of the files in /var/spool/sw

 
SOLVED
Go to solution
MAD_2
Super Advisor

What's the purpose of the files in /var/spool/sw

I have listed all of the depot sofware files in /var/spool/sw. However, when I use SAM to see if I can remove all local depot sofware, it tells me that:

"There is currently no depot software on host "myhost" at location "/var/spool/sw". Make sure that an absolute pathname is specified for location (beginning with "/")."

This occurs even though it shows that directory as one of the "target depot path" for registered Depots????

A lot of the depot software located there is taking tons of space from my directory "/var" which happens to be a logical volume and has dramatically increased it's used portion since I added some other patches. I do not want to keep resizing the volume. Can I get recommendations as far as how safe it is to remove the depot sofware and consequences of doing so? Also, can I get an explation of why SAM is not recognizing it as a depot path?

Thanks,
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
15 REPLIES 15
Michael Tully
Honored Contributor

Re: What's the purpose of the files in /var/spool/sw

/var/spool/sw is the default registered depot for software. The message from SAM seems to indicate that although there is software in the directory the software itself is not registered. Run the command

# /usr/sbin/swreg -l depot
This should produce some useful information as to what depots are registered on your system.

You can check that each of the software objects by using the following command and comparing it with /var/spool/sw

# /usr/sbin/swlist -l patch

In my opinion it will safe to remove these files anyway, as they are not apart of system installed software.
Anyone for a Mutiny ?
Michael Tully
Honored Contributor

Re: What's the purpose of the files in /var/spool/sw

Two things to add:

Software (patches) that have been installed will live in the appropriate directories. /usr/bin, /usr/sbin etc
You can check the state of these by using the '/usr/sbin/swlist -l patch -a patch_state' command.

Software patches that are now superceded can be found under the /var/adm/sw tree. You can clean these up by using the 'cleanup' command. There is a man page for this.
Anyone for a Mutiny ?
V. V. Ravi Kumar_1
Respected Contributor
Solution

Re: What's the purpose of the files in /var/spool/sw

hi

the following are the details of files in /var/adm/sw. i got it from swlist man page.
----------------------------------------------
$HOME/.swdefaults
Contains the user-specific default values for some or all SD
options. $HOME/.sw/sessions/
Contains session files automatically saved by the SD commands, or
explicitly saved by the user.
/usr/lib/sw/sys.defaults
Contains the master list of current SD options (with their
default values).
/var/adm/sw/
The directory which contains all of the configurable (and non-
configurable) data for SD. This directory is also the default
location of logfiles.
/var/adm/sw/defaults
Contains the active system-wide default values for some or all SD
options.

/var/adm/sw/host_object
The file which stores the list of depots registered at the local
host.
/var/adm/sw/products/
The Installed Products Database (IPD), a catalog of all products
installed on a system.
/var/spool/sw/
The default location of a source and target software depot.
--------------------------------------------
/var/adm/sw/save is a very important dierectory where it stores all the patch database which are either in applied or superceded state. When a patch is committed it will be removed from save directory.

u can safely delete the depot files which were created while unsharing the patch after download.

when u use swlist command it gets ths information from the patch database in /var/adm/sw/products.

regds
ravi
Never Say No
Mateja Bezjak
Respected Contributor

Re: What's the purpose of the files in /var/spool/sw

Hi,

There is a difference between the installed software and depot software. You can list the depot software by running "swlist -d" Installed software can be listed by running "swlist".

Check if there are any depots on /var:
swlist -l depot

Generally depot software can be removed easily. Depots are used as a source to distribute/install software. Depot can be removed by "swremove -d \* @ /location"

I hope this helps. Regards,
Mateja
MAD_2
Super Advisor

Re: What's the purpose of the files in /var/spool/sw

Thanks for all of the good information. This should do, I will give points based on the amount of detail provided by each and how much it applies to resolving my current situation. However, I think this will be good information for those who decide to research the same problem area. One more question to all:

How can I move the software patches/bundles from its current depot location to another and then register that one as the default?

The reason behind this, again, is resources. My /var directory is not as large as another couple of directories I have that are mostly used for data dumps, archive storage, etc.

Thanks,
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Mateja Bezjak
Respected Contributor

Re: What's the purpose of the files in /var/spool/sw

You can move all the software (patches, bundles) contained in a depot by using swcopy. Example:
swcopy -s /var/depot \* @ /tmp/depot

The above command will then copy everything in /var/depot to /tmp/depot.

########
# swcopy.source_directory = /var/spool/sw
#
# Defines the default location of the source depot. This syntax can be
# host:path.

A lot more information can be found in swcopy man pages.
Regards,
Mateja
Mateja Bezjak
Respected Contributor

Re: What's the purpose of the files in /var/spool/sw

I forgot to mention where option source_directory needs to be specified. This can be done in /var/adm/sw/defaults file and it would have to be changed for swinstall, swcopy and swpackage commands. Default is currently /var/spool/sw. To change it to /tmp/depot add to the defaults file:

swinstall.source_directory=/tmp/depot
swpackage.source_directory=/tmp/depot
swcopy.source_directory=/tmp/depot


MAD_2
Super Advisor

Re: What's the purpose of the files in /var/spool/sw

Mateja, could you explain a little more the:

########
# swcopy.source_directory = /var/spool/sw
#
# Defines the default location of the source depot. This syntax can be
# host:path.

Where is this located/specified? I did not see a location pointed out in your comment, maybe I am just missing it. And, I do not yet understand the "source_directory" part. Thanks!
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
MAD_2
Super Advisor

Re: What's the purpose of the files in /var/spool/sw

Ah, and one more question. I believe I asked this before:
How do I register a depot location (either a new one or register those I am using).

Although all of these patches/bundles are located in /var/spool/sw, every time I try to do something with them (swcopy or whatever) I keep getting the message:

"ERROR: Failed to start source agent on "/var/spool/sw" for root@hostname.
"/var/spool/sw" is not a valid depot."
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
MAD_2
Super Advisor

Re: What's the purpose of the files in /var/spool/sw

Sorry to keep bugging, but I still get:

"ERROR: There is currently no depot software on host "hostname" at location "/var/spool/sw"
Make sure that an absolute pathname is specified for location (beginning with "/").
* Source connection failed for "hostname:/var/spool/sw".
WARNING: More information may be found in the daemon logfile on this target (default location is hostname:/var/adm/sw/swagentd.log).
* Selection had errors."
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Mateja Bezjak
Respected Contributor

Re: What's the purpose of the files in /var/spool/sw

Hi,

That line was taken from /usr/lib/sw/sys.defaults

The source_directory can be used to specify where to look for the software when for example installing certain software. Setting the source_directory to another value than default (/var/spool/sw), has the same affect as using "-s" on the command line:
swcopy -s /tmp/depot patch @ /tmp/patch_depot
Having source_directory specified in the /var/adm/sw/defaults file, you can leave "-s /tmp/depot" out in the above command.

Here is also a link to the book (Managing HP-UX Software with SD-UX)
http://docs.hp.com/hpux/onlinedocs/B2355-90154/B2355-90154.html

Regards,
Mateja

Mateja Bezjak
Respected Contributor

Re: What's the purpose of the files in /var/spool/sw

I just saw some more questions..
Do you get the same error when running "swlist -d"? Then this means that you do not have any depot software at /var/spool/sw. You can go to /var/spool/sw dir and check.
What is the output of "swlist -d"?
Mateja Bezjak
Respected Contributor

Re: What's the purpose of the files in /var/spool/sw

One more thing that came to my mind. Is this depot registered? You might be experiencing problems because it is not registered.
swreg -l depot /var/spool/sw
MAD_2
Super Advisor

Re: What's the purpose of the files in /var/spool/sw

Mateja,
Thanks for your prompt replies. I had already tried the "swreg -l depot /var/spool/sw" before your post, but still get the ERROR message I've shown above.
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Darrell Allen
Honored Contributor

Re: What's the purpose of the files in /var/spool/sw

If you are installing your depots on the same host, you don't have to register them.

I don't worry about swinstall messages for /var/spool/sw. I simply ignore them. It's the default depot but you don't have to use it. The patches and products I download are generally in depot form and I simply specify that as the depot I want to use. I don't register them. I use them then delete them after being sure I don't need to reinstall.

Michael's comments about listing the patch_state can be helpful. Do you "commit" your patches? If not (and presuming you take the default approach to save filesets being superceded) then a good bit of space in /var is being used to hold superceded filesets. You should use the cleanup command to commit patches after you've run with them for a while.

As a general rule, I commit patches that have been superceded twice. I definitely wouldn't commit new patches until the system has run a while with them (at least half a year although I have seen patches "recalled" that had been running nearly a year).

I believe you can safely remove your depot files in /var/spool/sw. If you have registered depots there, I'd unregister them first although I believe you'd be safe to do so afterwards.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)