Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

11.4. Install Patches in Zip Form

11.4.1. The patch Command

The patch command is used to apply downloaded zip patches to a single JBoss EAP 6 server instance. It cannot be used to automatically patch JBoss EAP 6 server instances across a managed domain, but individual server instances in a managed domain can be patched independently.

Important

JBoss EAP 6 server instances which have been installed using the RPM method cannot be updated using the patch command. Refer to Section 11.5, “Install Patches in RPM form” to update RPM-installed JBoss EAP 6 servers.

Note

The patch command can only be used with patches produced for versions of JBoss EAP 6.2 and later. For patches for versions of JBoss EAP prior to 6.2, you should instead refer to the relevant version's documentation available at https://access.redhat.com/site/documentation/.
In addition to applying patches, the patch command can give basic information on the state of installed patches, and also provides a way to immediately rollback the application of a patch.
Before starting a patch application or rollback operation, the patch tool will check the modules and other miscellaneous files that it is changing for any user modifications. If a user modification is detected, and a conflict-handling switch has not been specified, the patch tool will abort the operation and warn that there is a conflict. The warning will include a list of the modules and other files that are in conflict. To complete the operation, the patch command must be re-run with a switch specifying how to resolve the conflict: either to preserve the user modifications, or to override them.

Table 11.1. patch Command Arguments and Switches

Argument or Switch Description
apply Applies a patch.
--override-all If there is a conflict, the patch operation overrides any user modifications.
--override-modules If there is a conflict as a result of any modified modules, this switch overrides those modifications with the contents of the patch operation.
--override=path(,path) For specified miscellaneous files only, this will override the conflicting modified files with the files in the patch operation.
--preserve=path(,path) For specified miscellaneous files only, this will preserve the conflicting modified files.
info Returns information on currently installed patches.
rollback Rollsback the application of a patch.
--reset-configuration=TRUE|FALSE Required for rollback, this specifies whether to restore the server configuration files as part of the rollback operation.

11.4.2. Installing Patches in Zip Form Using the patch Command

Summary

This task describes how to use the patch command to install patches for JBoss EAP 6 that are in the zip format.

Important

The patch command is a feature that was added in JBoss EAP 6.2. For versions of JBoss EAP prior to 6.2, the process to install patches in zip form is different, and you should instead refer to the relevant version's documentation available at https://access.redhat.com/site/documentation/.

Prerequisites

  • Valid access and subscription to the Red Hat Customer Portal.
  • A current subscription to a JBoss product installed in zip format.
  • Access to the Management CLI for the server instance to be updated. Refer to Launch the Management CLI in the Administration and Configuration Guide.

Procedure 11.2. Apply a zip patch to a JBoss EAP 6 server instance using the patch command

Warning

Before installing a patch, you should backup your JBoss product along with all customized configuration files.
  1. Download the patch zip file from the Customer Portal at https://access.redhat.com/downloads/
  2. From the Management CLI, apply the patch with the following command with the appropriate path to the patch file:
    [standalone@localhost:9999 /] patch apply /path/to/downloaded-patch.zip
    The patch tool will warn if there are any conflicts in attempting the apply the patch. Refer to Section 11.4.1, “The patch Command” for available switches to re-run the command to resolve any conflicts.
  3. Restart the JBoss EAP 6 server instance for the patch to take effect:
    [standalone@localhost:9999 /] shutdown --restart=true
Result

The JBoss EAP 6 server instance is patched with the latest update.

11.4.3. Rollback the Application of a Patch in Zip Form Using the patch Command

Summary

This task describes how to use the patch command to rollback the application of a previously applied zip patch in JBoss EAP 6.

Warning

Rolling back the application of a patch using the patch command is not intended as a general uninstall functionality. It is only intended to be used immediately after the application of a patch which had undesirable consequences.

Important

The patch command is a feature that was added in JBoss EAP 6.2. For versions of JBoss EAP prior to 6.2, the process to rollback patches in zip form is different, and you should instead refer to the relevant version's documentation available at https://access.redhat.com/site/documentation/.

Prerequisites

  • A patch that was previously applied using the patch command.
  • Access to the Management CLI for the server instance. Refer to Launch the Management CLI in the Administration and Configuration Guide.

Procedure 11.3. Rollback a patch from a JBoss EAP 6 server instance using the patch command

  1. From the Management CLI, use the patch info command to find the ID of the patch that is to be rolled back.
    • For cumulative patches, the patch ID is the value of the first cumulative-patch-id shown in the patch info output.
    • One-off security or bug fix patch IDs are listed as the value of the first patches shown in the patch info output, with the most recently applied one-off patch listed first.
  2. From the Management CLI, rollback the patch with the appropriate patch ID from the previous step.

    Warning

    Use caution when specifying the value of the --reset-configuration switch.
    If set to TRUE, the patch rollback process will also rollback the JBoss EAP 6 server configuration files to their pre-patch state. Any changes that were made to the JBoss EAP 6 server configuration files after the patch was applied will be lost.
    If set to FALSE, the server configuration files will not be rolled back. In this situation, it is possible that the server will not start after the rollback, as the patch may have altered configurations, such as namespaces, which may no longer be valid and have to be fixed manually.
    [standalone@localhost:9999 /] patch rollback PATCH_ID --reset-configuration=TRUE
    The patch tool will warn if there are any conflicts in attempting the rollback the patch. Refer to Section 11.4.1, “The patch Command” for available switches to re-run the command to resolve any conflicts.
  3. Restart the JBoss EAP 6 server instance for the patch rollback to take effect:
    [standalone@localhost:9999 /] shutdown --restart=true
Result

The patch, and optionally also the server configuration files, are rolled back on the JBoss EAP 6 server instance.