Using dupatch from the Command Line
Author: Copyright 2003 Hewlett-Packard Development Company, L.P.
Description: Patch Kit Installation Instructions: Tru64 UNIX Patch Kits

# C Using dupatch from the Command Line

The `dupatch` utility provides a command line interface that allows `dupatch` to be called by other programs. You can use the command line to invoke all functions except for baselining. The functions have the same operation and definition as the menu-driven interface. For information about using the command-line interface, see the `dupatch`(8) reference page, which is installed on your system when you install the patch-kit tools and is documented in this appendix.

The following example shows the use of the `dupatch` command and several of its options to install Patch 8.01 from a Version 5.0A kit:

    /usr/sbin/dupatch -install -kit /var/bl15/patch_kit -name Joe -note \
    "install patch" -product TRU64_UNIX_V5.0A -patch 08.01

The following example shows the use of the `dupatch` command and several of its options to remove Patch 8.01 from a Version 5.0A kit:

    /usr/sbin/dupatch -delete -name Joe -note "delete patch" \
    -product TRU64_UNIX_V5.0A -patch 08.01

You must specify all mandatory options on the command line or in a data file. If any mandatory option is missing, the command will fail with an appropriate error message; it will not prompt you for the missing option and information.

The rest of this appendix documents the `dupatch`(8) reference page.

### dupatch(8)

### NAME

`dupatch` - Installs, deletes and maintains software patch updates to the Tru64 UNIX operating system and TruCluster software products.

### Synopsis

`/usr/sbin/dupatch`

`/usr/sbin/dupatch -help` [`-data_file` ] [`-kit kit_location`] [`-patch_id` ] [`-rev`] [`-product_id`]

`/usr/sbin/dupatch -install` `-kit kit_location` `-name user_name` `-note user_note` `-patch` `all` | `patch_id` [`patch_id` ]... [`-cfgfile config_file`] [`-data data_file`] [`-noauto` ] [`-nobackup` ] [`-nolog` ] [`-noroll` ] [`-precheck_only` ] [`-proceed` ] [`-root root_path`] `-product` `[` `all` | `product_id` ] [`-single_user` ]

`/usr/sbin/dupatch -delete` `-name user_name` `-note user_note` `-patch` `all` | `patch_id` [`patch_id` ]... [`-cfgfile config_file`] [`-data data_file`] [`-noauto`] [`-nolog`] [`-noroll` ] [`-proceed` ] [`-root root_path` ] [`-product` `` `all` | `product_id`] [`-single_user` ]

`/usr/sbin/dupatch -track` `-type` `[` `file` | `kit` | `patch` ] `-kit kit_location` [`-data data_file`] [`-nolog` ] [`-root root_path` ]

### Command Keywords

-install install-options

  Installs a software patch or patch kit.

-delete delete-options

  Removes an installed patch or patches from the operating system. Patch deletion requires that the patch was installed as a reversible patch.

-track track-options

  Constructs a history of patch installations and deletions. Information can be patch-kit specific or patch-file specific.

-help help-options

  Requests quick help on dupatch. Supplying an argument will provide help specifically on that argument.

### Options

### Required -install Options

-kit kit_location

  Specifies the location of the patch kit from which patches will be installed onto the system.

  kit_location is a full path to the directory containing the patch kit.

-name user_name

  Specifies the name to be recorded in `event.log`. Enclose the user_name in quotation marks if it contains space characters.

-note user_note

  Records user-supplied text in the event log. The user_note is a text string enclosed in quotation marks.

-patch `all`
-patch patch_id [patch_id]...

  Directs `dupatch` to install all patches (`all`) patches or specific patches (patch_id) from the specified patch kit. -patch is optional with -precheck_only. See Specifying a Patch ID.

-product product_id [product_id]...

  Required when more than one product is available for operation.

  Specifies the installed operating system and/or TruCluster software product to be patched. Product ID specifications are case insensitive. Wildcards are not permitted. See Specifying a Product ID.

### Optional -install Options

-cfgfile config_file

  Specifies a configuration file for rebuilding the kernel. See Specifying a Configuration File.

-data data_file

  Specifies a file that contains arguments (in the form argument = value) to the `dupatch` command. See Using a Data File.

-noauto

  Directs `dupatch` to not automatically rebuild the kernel if indicated by the patches installed. In addition, if running `dupatch` to install the patches in single-user mode, the system will not automatically reboot after the patch process is complete.

-nobackup

  Directs `dupatch` to not retain backup information during a patch installation. This will remove the ability to back out an installed patch.

-nolog

  Directs `dupatch` to not record actions in a `session.log` file.

-noroll

  Directs `dupatch` to install patches on a cluster using the no-roll procedure rather than the default rolling-upgrade procedure.

-precheck_only

  Directs `dupatch` to perform the preinstallation check but to not proceed with the patch installation. If -precheck_only is omitted, `dupatch` begins the installation process after the preinstallation check has been completed, as long as no patch failed the preinstallation check. The preinstallation check determines whether new patches that depend on the presence of other patches or software subsets can be installed. It does this by verifying that the required patches or software subsets are already installed onto the system.

-proceed

  Directs `dupatch` to install any patches that passed the preinstallation check, even if one or more patches failed the preinstallation check. If -proceed is omitted, `dupatch` will not install any patches if at least one patch fails the preinstallation check. The preinstallation check determines whether new patches that depend on the presence of other patches or software subsets can be installed. It does this by verifying that the required patches or software subsets are already installed onto the system.

-root root_path

  Specifies an alternate root location. The default root_path is `/` for all operations.

-single_user

  If the system is presently in multiuser mode, brings the system down to single-user mode prior to installing patches.

-rev

  Prints the current dupatch revision.

### Required -delete Options

-name user_name

  Specifies the name to be recorded in `event.log`. Enclose the user_name in quotation marks if it contains space characters.

-note user_note

  Records user-supplied text in the event log. The user_note is a text string enclosed in quotation marks.

-patch `all`
-patch patch_id [patch_id]...

  Directs `dupatch` to remove all `all` patches or specific (patch_id) patches from the specified patch kit. See Specifying a Patch ID.

-product product_id [product_id]...

  Mandatory when more than one product is installed.

  Specifies the installed operating system and/or TruCluster software product to be patched. Product ID specifications are case insensitive. Wildcards are not permitted. See Specifying a Product ID.

###

### Optional -delete Options

-data data_file

  Specifies a file that contains arguments (in the form argument = value) to the `dupatch` command. See Using a Data File.

-nolog

  Directs `dupatch` to not record actions in a `session.log` file.

-noroll

  Directs `dupatch` to remove patches on a cluster using the no-roll procedure rather than the default rolling-upgrade procedure.

-proceed

  Directs `dupatch` to delete any patches that passed the predeletion check, even if one or more patches failed the predeletion check. If -proceed is omitted, `dupatch` will not delete any patches if at least one patch failed the predeletion check. The predeletion check determines whether any installed patches have dependencies on any of the patches listed for removal. If such dependencies exist, `dupatch` blocks the removal of any required patch.

-root root_path

  Specifies an alternate root location. The default root_path is `/` for all operations.

### Required -track Options

-type file
-type kit
-type patch

  Lists all patched files (-file), installed patch kits (-kit), or installed patches (-patch).

### Optional -track Options

-data data_file

  Specifies a file that contains arguments (in the form argument = value) to the `dupatch` command. See Using a Data File.

-kit kit_location

  Identifies the location of the patch kit for which the reports will cover.

  kit_location is a full path to the directory containing the patch kit.

-nolog

  Directs `dupatch` to not record actions in a session.log file.

-root root_path

  Specifies an alternate root location. The default root_path is `/` for all operations.

### Description

The `dupatch` utility is an interactive program used to install and delete software patches to the Tru64 UNIX operating system and systems running TruCluster software products.

With `dupatch` you can baseline your system to incorporate any system files that may have been manually installed. You can also use `dupatch` to obtain a list of installed patches or view the system history of patch installations and deletions.

When invoked without arguments, `dupatch` is run interactively by providing menus that step you through the patching procedure while prompting you for necessary information. Alternatively, you can invoke `dupatch` from the command line, whereby you supply required arguments to the `dupatch` command.

Although you can install patches in either single-user or multiuser mode, the use of single-user mode is strongly recommended. In multiuser mode, libraries and system files that are in use by active processes may be affected by the new patches. The patching of any active library or system files may result in unexpected consequences.

On clustered systems running TruCluster software Version 5.0A or higher, the `dupatch` utility is run in conjunction with the rolling upgrade procedure. (See the Patch Kit Installation Instructions or the Cluster Installation manual for information about performing a rolling upgrade.)

### Using a Data File

The data_file that you specify with the -data option is a fully qualified file location and a file that contains command-line options with the following format:

option1 = value
option2 = value
.
.
.
option3 = n

For example:

    kit  = /mnt
    name  =  Joe
    note  =  Installing April patch kit
    product = Tru64_UNIX_V5.1
    patch   = 27.01 63.00 74 83.01
    product = TruCluster_V5.1
    # multiple patches are separated by space characters
    patch   = 21.01 27.01 40
    precheck_only
    nobackup

Blank lines and comments (preceded with #) are allowed. Line continuation ( \ ) is required if a specification spans multiple lines. Only one data_file is permitted per command line and nested data_file specifications are not allowed.

### Specifying a Product ID

The product_id you specify with the -product option is one of the following:

      TRU64_UNIX_V5.1
      TRU64_UNIX_V5.0A
      TRU64_UNIX_V5.0
      TRU64_UNIX_V4.0G
      TRU64__UNIX_V4.0F
      DIGITAL_UNIX_V4.0D

      TruCluster_V5.1
      TruCluster_V5.0A
      TruCluster_V1.6
      TruCluster_V1.5

- A product_id specification is not necessary when the system being patched has only one product installed; for example, Tru64 UNIX Version 4.0F with no TruCluster software product.

- A product_id specification only applies to the patch_id specifications that follow it and ends when another product_id is specified.

- Because the purpose of the product_id is to clarify the patch_id specification, the product_id must precede the patch_id.

- Product strings are not case sensitive. Wildcards are not permitted.

The following example shows a product string:

    dupatch -install -product DIGITAL_UNIX_V4.0F -patch 1.1 -product TruCluster_V1.6 -patch 35 \
     -name Joe -note "installing patch 1.1" -kit

### Specifying a Patch ID

The patch_id you specify with the -patch option has the following format:

    xxxx[.yy]

For example:

    15
    200.11
    10.2
    00111.02

- Both xxxx and yy are numeric values; leading zeros can be omitted.

- Patch revision (yy), when left unspecified, maps to wildcarded "??"

- Multiple patch_id specifications are separated by white space.

- The keyword `all` cannot be combined with other patch IDs.

- If product_id is used, patch_id must come after it.

### Specifying a Root Path

The root_path you specify with the -root option specifies an alternative root for the specified operation. (The -root option is similar to the -D option of `setld`.) The following list describes characteristics of the -root option.

- The root path must be the root of a complete UFS file system or AdvFS domain.

- The default root path is `/` for all operations.

- If -root is the only argument on the command line, `dupatch` will proceed in interactive mode; this is an exception to the command-line rule previously mentioned.

- When performing an alternate root installation, the -noauto flag is set implicitly.

### Specifying a Configuration File

The -cfgfile option to the -install and -delete command options allows you to call in the system configuration file (`/usr/sys/conf/config_file`). For information about creating or modifying a `config_file`, see the `doconfig`(8) and `sizer`(8) reference pages.

### Restrictions

The following restrictions apply to the `dupatch` utility.

You must be logged in as `root` to run `dupatch`.

The system must be running in single-user mode when removing patches.

The -product option must precede the -patch option on the command line.

### Exit Status

`0` (Zero)

  Success.

`>0`

  An error occurred.

### Errors

See the Patch Kit Installation Instructions for a detailed list of dupatch error messages.

### Examples

1. The following interactive example shows how to invoke the menu-driven interface of `dupatch`:

       # dupatch

       Tru64 UNIX Patch Utility (Rev. 34-00)
       ==========================
       	- This dupatch session is logged in /var/adm/patch/log/session.log

           Main Menu:
           ---------

           1)  Patch Installation
           2)  Patch Deletion

           3)  Patch Documentation
           4)  Patch Tracking

           5)  Patch Baseline Analysis/Adjustment

           h)  Help on Command Line Interface

           q)  Quit

       Enter your choice: 1

2. The following interactive example shows how to perform a preinstallation check on patch 00183.00 contained in the kit located at /mnt/patch_kit. This will verify that the specified patch can be installed onto the system without actually proceeding with the installation:

       # dupatch -install -kit /mnt/patch_kit  -name Jessica -note \
       "Pre-Installation check only on 183.00" -patch 183.00 -precheck_only

3. The following interactive example shows how to install all patches in kit located at /mnt/patch_kit:

       # dupatch -install -kit /mnt/patch_kit  -name Jessica \
       -note "install all patches" -patch all

4. The following interactive example shows how to identify all patches installed on system:

       # dupatch -track -type patch

5. The following interactive example shows how to list all system files updated by installed patches:

       # dupatch -track -type file

6. The following interactive example shows how to remove patch 00183.00 from the system. Note that the system will automatically be rebooted upon patch deletion because `-noauto` was not specified:

       # dupatch -help patch_id

7. The following interactive example shows how to obtain help on specifying patch_id usage:

       # dupatch -delete -patch 183.00 -name Joe \
       -note "delete patch 00183.00 from system"

### Environment Variables

The following environment variables affect the execution of `dupatch`:

`MAX_LOGS`

  Specifies the maximum number of session logs to be retained on the system. The default number is 25. If, for example, `MAX_LOGS` is set to 25, the oldest session log would be named `session.log.24` and the current would be named `session.log`, with no number affixed.

`_ROOT`

  Overrides the location of the root directory. The default value is /, the system root directory. This value must be the top-level directory of a file system (or an AdvFS domain).

`PATCHDIR`

  Specifies the path to the patch tools repository. The default value is `$_ROOT/var/adm/patch`.

### Files

`/var/adm/patch/log/session.log.n`

  This file captures `dupatch` activities. A separate session log is written with each `dupatch` session and log files from the previous sessions are saved. The order is first in, first out, with `session.log.$MAX_LOGS` as the oldest file.

`/var/adm/patch/log/Dupatch_load_Date.log`

  This file specifies the date when the patch tools were loaded or updated onto the system.

`/var/adm/patch/log/baseline.log.n`

  This file records the screen output from the baselining session. A separate baseline log is written for each baselining session and log files from previous sessions are saved. The order is first in, first out, with `session.log.$MAX_LOGS` as the oldest file.

`/var/adm/patch/log/event.log.n`

  This file captures information regarding patch installation and removal operations. A separate event log is written each time patches are installed or removed. Log files from previous sessions are saved. The order is first in, first out, with `session.log.$MAX_LOGS` as the oldest file.

`/var/adm/patch/backup`

  The files in this directory are used to restore the system to its former state if patches are deleted.

`/var/adm/patch/doc/OSFPAT*patch_no.abs`

  Provides brief summary of what a patch fixes.

`/var/adm/patch/doc/OSFPAT*patch_no.txt`

  Provides detailed discussion of what a patch fixes.

`root-path/usr/.smdb./OSFPAT*.inv`

  Lists the subset inventory files.

`root-path/usr/.smdb./OSFPAT*.ctrl`

  Lists the subset control files.

`root-path/usr/.smdb./OSFPAT*.scp`

  Lists the subset inventory programs.

`root-path/usr/.smdb./OSFPAT*.lk`

  Lists the subset installed lock files.

### See Also

Commands: `setld`(8), `clu_upgrade`(8)

Documents:

Patch Installation Instructions

Patch Summary and Release Notes supplied with the patch kit to be installed

Tru64 UNIX Installation Guide

Tru64 UNIX System Administration manual

TruCluster Software Products Software Installation manual for the installed 4.0n or 5.n cluster system

TruCluster Software Products Cluster Administration manual for the installed 4.0n or 5.n cluster system