Friday, December 18, 2009

Software & Patch Management in HP-UX - Part 1

Software and patch management in HP-UX is done using HP Software Distributor called SD-UX. This is a set of commads, utilities, also the definitions of software packages, bundles. It got a several set of commands for the installation, removal, listing and the verification of softwares and patches. You can even setup a server as a central software server so that client HP-UX machines can do software installtion thru the network.

Few Common Terms in SD-UX :

Fileset:
       It is the smalled installable software unit. It consists of files and control scripts. It can belong to only 1 product, but can  be included multiple subproducts and bundles.

Here is an example:   Keyshell.KEYS-END-A-MAN B.11.30

where
1st field is the fileset name
2nd field is the fileset version

Sub-Product:
       Subproduct is nothing but the logically related filesets.

Here is an example:
    X11.MessagesByLang           X11 Localized Messages

This subproduct contains the filesets for X11 messages in several languages.

Product:
      It is nothing but a set of filesets. In another words, it is a superset of filesets / subproducts.

Here is an example ,

X11         B.11.30   HP-UX X Windows Software

where
X11 is the product name
B.11.30 is the product version
third field is the product description

Bundle:
It contains filesets that may belong to different products. Bundles are usually packaged by HP for the software distribution.

Here is an example,

OnlineDiag  B.11.20.06 HP-UX 11.0 Support Tools Bundle

Software Depot:

It is the place where filesets, products and bundles are kept. It can be a directory or cd-rom or tape. By default, the software depot is /var/spool/sw. You can also maintain software depot on a central server for the installtion over the network. You can have multiple software depots in a server for different purposes or applications. You can add new softwares to the depot and install them whenever required.

Points to remember:
1. SD-UX keeps stores all the information about the installed software and catalog files for software in depots in a database called Installed Product Database (IPD).
2. SD-UX commands create, modify the IPD and cataog files.
3. IPD is located in /var/adm/sw/products.

What is Protected Software and How to install it ?

             HP provides certain software in protected mode. HP will provide you the codeword and your customer id for installing that software. codeword is based on the customer id, product id and the part number of the software storage medium.
            You need to mention the customer id and codeword for the firsttime you install the software. At that time, the codeword gets stored in /var/adm/sw/.codewords file. After this, you dont have to mention the codeword for installing that software (from that particular cd-rom media)  in that machine.


Software Agent Daemon :

           Software installtion is controlled by the daemon called "swagentd". You need to have this daemon running for the installation of the software in HP-UX.
           Whenever you execute swinstall command, it contacts the swagentd daemon which starts a software agent called swagent. If the installation over the network, the local swagentd daemon contacts the daemon running on the other machine.
           This daemon gets started at runlevel 2. Hence its not possible to install the software in single-user or maintenance mode. If you need to install software in single-user mde, first you have to manually start this daemon.

To start swagentd :
# /sbin/init.d/swagentd start

To stop swagentd :
# /sbin/init.d/swagentd stop

How to list the softwares ?

To list the installed bundles :
# swlist -l bundle

To list the installed products :
# swlist -l product

To list the installed subproducts :

# swlist -l subproduct

To list the installed filesets alone :
# swlist -l fileset

To list the softwares in depot /var/spool/sw :
# swlist -d @ /var/spool/sw

To list the softwares in depot /var/spool/sw located in a remote server :
# swlist -d @ server1:/var/spool/sw

To list all the files belonging to the product X11 :
# swlist -l file X11

To list softwares in a tape drive :
# swlist -d @ /dev/rmt/0m

To list softwares available in a cd-rom drive :
# swlist -d @ /SD_CDROM

To open swlist in GUI mode :
# swlist -i

To open swlist in GUI mode for software depot :
# swlist -i -d

To view the readme file for a product :
# swlist -a readme OS-Core

To show whether software available on cd-rom requrie a codeword or not :
# swlist -d -a is_protected @ /SD_CDROM

How to install software ?

You can use swinstall command to install the softwares available in the cd-rom, tape, local software depot or software depot on a remote server. All the activities of swinstall command are logged in the /var/adm/sw/swinstall.log file.

To install software from a local tape drive :
# swinstall -s /dev/rmt/0m

To install software from a local cd-rom drive :
# swinstall -s /SD_CDROM

Note: If you're using HP-UX 11.2 and earlier versions, you have to mount the cd-rom on /SD_CDROM before using the above command.

How to remove the installed softwares ?

You can use swremove command to remove the installed softwares. All the activities of swremove command are logged in the /var/adm/sw/swremove.log file.

How to verify the installed softwares ?

You can use swverify command to verify the consistency of the software installed in the system or in the software depot. All the activities of swremove command are logged in the /var/adm/sw/swremove.log file.

How to manage softwares in the software depot ?

To copy softwares from a tape to the default depot :
# swcopy -s /dev/rmt/0m @ /var/spool/sw

To copy softwares from a cd-rom drive to the default depot :
# swcopy -s /SD_CDROM @ /var/spool/sw

To remove softwares from a depot :
# swremove -d * @ /var/spool/sw

To list softwares in a depot :
# swlist -d @ /var/spool/sw

We will look at the patch management in the next part.

No comments:

Post a Comment