此内容没有您所选择的语言版本。
11.4. Install Patches in Zip Form
11.4.1. The patch Command 复制链接链接已复制到粘贴板!
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
patch command. Refer to Section 11.5, “Install Patches in RPM form” to update RPM-installed JBoss EAP 6 servers.
Note
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/.
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.
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.
| 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. |
This task describes how to use the patch command to install patches for JBoss EAP 6 that are in the zip format.
Important
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
- Download the patch zip file from the Customer Portal at https://access.redhat.com/downloads/
- 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
[standalone@localhost:9999 /] patch apply /path/to/downloaded-patch.zippatch apply /path/to/downloaded-patch.zipCopy to Clipboard Copied! Toggle word wrap Toggle overflow Thepatchtool will warn if there are any conflicts in attempting the apply the patch. Refer to Section 11.4.1, “ThepatchCommand” for available switches to re-run the command to resolve any conflicts. - Restart the JBoss EAP 6 server instance for the patch to take effect:
[standalone@localhost:9999 /] shutdown --restart=true
[standalone@localhost:9999 /] shutdown --restart=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The JBoss EAP 6 server instance is patched with the latest update.
This task describes how to use the patch command to rollback the application of a previously applied zip patch in JBoss EAP 6.
Warning
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
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
patchcommand. - 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
- From the Management CLI, use the
patch infocommand 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-idshown in thepatch infooutput. - One-off security or bug fix patch IDs are listed as the value of the first
patchesshown in thepatch infooutput, with the most recently applied one-off patch listed first.
- 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-configurationswitch.If set toTRUE, 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 toFALSE, 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
[standalone@localhost:9999 /] patch rollback PATCH_ID --reset-configuration=TRUEpatch rollback PATCH_ID --reset-configuration=TRUEpatch rollback PATCH_ID --reset-configuration=TRUEpatch rollback PATCH_ID --reset-configuration=TRUECopy to Clipboard Copied! Toggle word wrap Toggle overflow Thepatchtool will warn if there are any conflicts in attempting the rollback the patch. Refer to Section 11.4.1, “ThepatchCommand” for available switches to re-run the command to resolve any conflicts. - Restart the JBoss EAP 6 server instance for the patch rollback to take effect:
[standalone@localhost:9999 /] shutdown --restart=true
[standalone@localhost:9999 /] shutdown --restart=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The patch, and optionally also the server configuration files, are rolled back on the JBoss EAP 6 server instance.