12.10 Installing Patches

     

We look at installing patches from a patch-only depot as well as from a software-and-patches depot; while the behavior is similar, there are some subtle differences.

12.10.1 Installing patches from a patch-only depot

In this example, we have the base product installed on our system. We may even have an earlier patch for the product already installed, as is the case here:

 

 root@hpeos004[]  swlist -l patch -a patch_state FooProd  # Initializing... # Contacting target "hpeos004"... # # Target:  hpeos004:/ # # FooProd # FooProd.FOO-HELP # FooProd.FOO-MIN   PHCO_1000.FOO-MIN     applied root@hpeos004[] 

We have the patch PHCO_1000 already installed as well as loaded in our patch depot. Obviously, if we try to install it, swinstall will fail because it is already installed. If necessary, we can override that behavior by using the option reinstall=true . Before installing any patch, you should check whether it will force a reboot; but you already know the answer to that question because you have studied all the README (.text) files for all the patches you are going to install, haven't you? If we want to install, we simply select it from the depot. If swinstall cannot resolve any dependencies, it will fail. For instance, if we try to install patch PHCO_4000 , there is a co-requisite for this patch of the FooProd product itself. We have that already installed. There is also a prerequisite of PHCO_3000 that isn't installed. To resolve this, swinstall will automatically select this patch from the depot. If it is not present, swinstall will again fail. To be on the safe side, I would always use the option patch_match_target=true to ensure that you select only the most recent and valid patches for your systems. Let's have a look:

 

 root@hpeos004[]  swinstall x patch_match_target=true -s /software/11i-PA PHCO_4000  =======  09/26/03 15:51:58 BST  BEGIN swinstall SESSION          (non-interactive) (jobid=hpeos004-0080)        * Session started for user "root@hpeos004".        * Beginning Selection        * Target connection succeeded for "hpeos004:/".        * Source connection succeeded for "hpeos004:/software/11i-PA". WARNING: Multiple filesets claim to supersede another fileset. SD will          use "PHCO_3000.FOO-MIN,fa=HP-UX_B.11.00_32/64" (which was          automatically selected because it is a dependency of another          fileset you selected) but cannot use the superseding fileset          for it. WARNING: Multiple filesets claim to supersede another fileset. SD will          use "FooProd.FOO-MIN,fa=HP-UX_B.11.00_32/64" (which was          automatically selected because it is a dependency of another          fileset you selected) but cannot use the superseding fileset          for it.        * Source:                 /software/11i-PA        * Targets:                hpeos004:/        * Software selections:            + FooProd.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64            + PHCO_3000.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64              PHCO_4000.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64        * A "+" indicates an automatic selection due to dependency or          the automatic selection of a patch or reference bundle.        * Selection succeeded.        * Beginning Analysis and Execution        * Session selections have been saved in the file          "/.sw/sessions/swinstall.last".        * "hpeos004:/":  1 filesets have the selected revision already          installed.        * "hpeos004:/":  1 filesets were determined to be skipped in the          analysis phase.        * Analysis and Execution succeeded. NOTE:    More information may be found in the agent logfile using the          command "swjob -a log hpeos004-0080 @ hpeos004:/". =======  09/26/03 15:52:09 BST  END swinstall SESSION (non-interactive)          (jobid=hpeos004-0080) root@hpeos004[] 

The warnings are perfectly understandable because we have multiple revisions of the patch in the depot. Software Distributor will select the most up-to-date revision of the patch that also matches the prerequisite for patch PHCO_4000 . We also see that Software Distributor has detected that we already have FooProd installed ( 1 filesets have the selected revision already installed ) and will not reinstall it.

The patch_match_taget=true is an excellent option to remember because, when you have a large patch depot with hundreds of patches set up, you can simply use this option without actually specifying which patches you want installed. Software Distributor will automatically select all the most recent patches in the depot that correspond to software installed on your system. In this way, we can bring a machine to a given patch level by a single command. Note: You will probably have to use the option “x autoreboot=true in such a situation to ensure that swinstall reboots the system once the patch installation is complete.

Once the installation is complete, we should check that everything went okay by checking the file /var/adm/sw/swinstall.log , although this will only show us what we saw on-screen. Personally, I prefer the file /var/adm/sw/swagent.log , which will give us the gory details of any warnings and errors. We should also check the patch_state to ensure that the patches were installed and configured. This should result in a patch_state of applied :

 

 root@hpeos004[]  swlist -l patch -a patch_state FooProd  # Initializing... # Contacting target "hpeos004"... # # Target:  hpeos004:/ # # FooProd # FooProd.FOO-HELP # FooProd.FOO-MIN   PHCO_1000.FOO-MIN     applied   PHCO_3000.FOO-MIN     applied   PHCO_4000.FOO-MIN     applied root@hpeos004[] 

This looks okay. Let's move on and look at installing patches from a software-and-patches depot.

12.10.2 Installing patches from a software-and-patches depot

In our example of a software-and-patches depot, we have a product called FooProd and a series of associated patches. We can install from a software-and-patches depot in the same way as from a patch-only depot. The beauty of a software-and-patches depot is the ease with which you can install base software and its associated patches with one command. If we simply install the product with the defaults behavior of swinstall , we will utilize the options autoselect_dependencies=true and autoselect_patches=true . This will result in picking up all the patches in the depot relating to the product. Software Distributor is clever in knowing about the superseded attribute and will give us only the most recent incarnation of the patch. In our case, that means we should load FooProd , PHCO_3000 , and PHCO_4000 ( PHCO_4000 does not supersede PHCO_3000 but has it as a prerequisite). I have read all the patch README ( .text ) files, and they tell me that neither the product nor any of its patches require a reboot as part of the installation. I can check this with a quick swlist command:

 

 root@hpeos004[]  swlist -l fileset -d -a is_reboot @ /software/11i-PA  # Initializing... # Contacting target "hpeos004"... # # Target:  hpeos004:/software/11i-PA # # FooProd   FooProd.FOO-HELP      false   FooProd.FOO-MIN       false # PHCO_1000   PHCO_1000.FOO-MIN     false # PHCO_2000   PHCO_2000.FOO-MIN     false # PHCO_3000   PHCO_3000.FOO-MIN     false # PHCO_4000   PHCO_4000.FOO-MIN     false root@hpeos004[] 

Let's see what messages we receive when we install FooProd :

 

 root@hpeos004[]  swinstall -s /software/11i-PA FooProd  =======  09/26/03 15:19:02 BST  BEGIN swinstall SESSION          (non-interactive) (jobid=hpeos004-0070)        * Session started for user "root@hpeos004".        * Beginning Selection        * Target connection succeeded for "hpeos004:/".        * Source connection succeeded for "hpeos004:/software/11i-PA". WARNING: Multiple filesets claim to supersede another fileset. SD will          use "FooProd.FOO-MIN,fa=HP-UX_B.11.00_32/64" (which was          automatically selected because it is a dependency of another          fileset you selected) but cannot use the superseding fileset          for it.        * Source:                 /software/11i-PA        * Targets:                hpeos004:/        * Software selections:              FooProd.FOO-HELP,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64              FooProd.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64            + PHCO_3000.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64            + PHCO_4000.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64        * A "+" indicates an automatic selection due to dependency or          the automatic selection of a patch or reference bundle.        * Selection succeeded.        * Beginning Analysis and Execution        * Session selections have been saved in the file          "/.sw/sessions/swinstall.last".        * The analysis phase succeeded for "hpeos004:/".        * The execution phase succeeded for "hpeos004:/".        * Analysis and Execution succeeded. NOTE:    More information may be found in the agent logfile using the          command "swjob -a log hpeos004-0070 @ hpeos004:/". =======  09/26/03 15:19:13 BST  END swinstall SESSION (non-interactive)          (jobid=hpeos004-0070) root@hpeos004[] 

As predicted , we have loaded FooProd , PHCO_3000 , and PHCO_4000 . The warning you see in the output tells us that. If we are installing a patch over the network using the Software Distributor pull method, the swlist / swinstall commands are simple in that we issue the commands on the machine where the installation will take place with a source depot including the hostname/IP address of the patch server:

 

 root@hpeos003[]  swlist -l depot @ hpeos004  # Initializing... # Target "hpeos004" has the following depot(s):   /depots/patches   /software/11i-PA root@hpeos003[] root@hpeos003[]  swlist -s hpeos004:/software/11i-PA  # Initializing... # Contacting target "hpeos004"... # # Target:  hpeos004:/software/11i-PA # # # No Bundle(s) on hpeos004:/software/11i-PA # Product(s): #   FooProd       1.0            This is an example 11.X product.   PHCO_1000     1.0            Foo Cumulative Patch   PHCO_2000     1.0            Foo Cumulative Patch   PHCO_3000     1.0            Foo Cumulative Patch   PHCO_4000     1.0            Foo Cumulative Patch root@hpeos003[] root@hpeos003[]  swinstall -s hpeos004:/software/11i-PA FooProd  =======  09/26/03 10:30:20 BST  BEGIN swinstall SESSION          (non-interactive) (jobid=hpeos003-0037)        * Session started for user "root@hpeos003".        * Beginning Selection        * Target connection succeeded for "hpeos003:/".        * Source connection succeeded for "hpeos004:/software/11i-PA". WARNING: Multiple filesets claim to supersede another fileset. SD will          use "FooProd.FOO-MIN,fa=HP-UX_B.11.00_32/64" (which was          automatically selected because it is a dependency of another          fileset you selected) but cannot use the superseding fileset          for it.        * Source:                 hpeos004:/software/11i-PA        * Targets:                hpeos003:/        * Software selections:              FooProd.FOO-HELP,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64              FooProd.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64            + PHCO_3000.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64            + PHCO_4000.FOO-MIN,r=1.0,a=HP-UX_B.11.00_32/64,v=HP,fr=1.0,fa=HP-UX_B.11.00_32/64        * A "+" indicates an automatic selection due to dependency or          the automatic selection of a patch or reference bundle.        * Selection succeeded.        * Beginning Analysis and Execution        * Session selections have been saved in the file          "/.sw/sessions/swinstall.last".        * The analysis phase succeeded for "hpeos003:/".        * The execution phase succeeded for "hpeos003:/".        * Analysis and Execution succeeded. NOTE:    More information may be found in the agent logfile using the          command "swjob -a log hpeos003-0037 @ hpeos003:/". =======  09/26/03 10:30:33 BST  END swinstall SESSION (non-interactive)          (jobid=hpeos003-0037) root@hpeos003[] 

In the next chapter, we look at the Software Distributor push method of installing software/patches.

Again, we should check the swinstall.log , and swagent.log logfiles as well as check he state of the patch(es).

 

 root@hpeos004[]  swlist -l patch -a patch_state FooProd  # Initializing... # Contacting target "hpeos004"... # # Target:  hpeos004:/ # # FooProd # FooProd.FOO-HELP # FooProd.FOO-MIN   PHCO_3000.FOO-MIN     applied   PHCO_4000.FOO-MIN     applied root@hpeos004[] 

This looks okay. We now move on to discussing removing patches and committing patches.



HP-UX CSE(c) Official Study Guide and Desk Reference
HP-UX CSE(c) Official Study Guide and Desk Reference
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 434

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net