You apply patches to WSO2 products either as individual patches or through a service pack. A service pack is recommended when the number of patches increase. The following sections explain the WSO2 patch application process:
- Applying service packs to the Kernel
- Applying individual patches to the Kernel
- Verifying the patch application
- Overview of the patch application process
Tip |
---|
Before you begin
|
Applying service packs to the product
From version 4.2.0 onwards, Carbon Kernel supports service packs. A service pack is a collection of patches in a single pack. It contains two elements:
- The
lib
directory: contains all the JARs relevant to the service pack. - The
servicepack_patches.txt
text file: contains the list of JARs in the service pack.
Follow the steps below to apply service packs to your product.
- Copy the service pack file to the
<PRODUCT_HOME>/repository/components/servicepacks/
directory. For example, the image below shows how a new service pack namedservicepack001
is added to this directory. - Start your product. The following steps will be executed:
Before applying any patches, the process first creates a backup folder named
patch0000
inside the<PRODUCT_HOME>/repository/components/patches/
directory, which will contain the original content of the<PRODUCT_HOME>/repository/components/plugins/
directory. This step enables you to revert back to the previous state if something goes wrong during operations.- The latest service pack in the
<PRODUCT_HOME>/repository/components/servicepacks/
directory will be applied. That is, the patches in the service pack will be applied to the<PRODUCT_HOME>/repository/components/plugins/
directory. In addition to the service pack, if there are individual patches added to the
<PRODUCT_HOME>/repository/components/patches/
directory, those will also be incrementally applied to theplugins
directory.Info The metadata file available in the service pack will maintain a list of the applied patches by service pack. Therefore, the metadata file information will be compared against the
<PRODUCT_HOME>/repository/components/patches/
directory, and only the patches that were not applied by the service pack will be incrementally applied to theplugins
directory.
Applying individual patches to the product
You can apply each patch individually to your system as explained below. Alternatively, you can apply patches through service packs as explained above.
...
Note |
---|
WSO2 has introduced the WSO2 Update Manger (WUM), which is a command-line tool that allows you to update your product with the latest available patches and enhancements. You can see if your product version is supported by WUM from here, and if it is supported, follow the instructions in Updating your WSO2 product to get the latest patches. |
The patch application process described below guides you on how to manually apply security patches to Carbon 4.4.x-based products (if your product version is currently not supported by WUM).
Table of Contents
Applying patches to the product
You can apply patches to your product in two ways:
- Apply each patch individually.
- If you want to apply multiple patches, create a collective patch and apply it to the product. A collective patch is a single patch that includes all the JAR files from the individual patches that should be applied.
Follow the steps given below to apply an individual patch or a collective patch to the product:
- Copy the patches to the
<PRODUCT_HOME>/repository/components/patches/ patches
directory. Start the product Carbon server. The patches will then be incrementally applied to the
plugins
directory.Note Before applying any patches, the process first creates a backup folder named
patch0000
inside the<PRODUCT_HOME>/repository/components/patches/
directory, which will contain the original content of the<PRODUCT_HOME>/repository/components/plugins/
directory. This step enables you to revert back to the previous state if something goes wrong during operations.
Info |
---|
Prior to Carbon 4.2.0 version, users were expected to apply patches by starting the server with |
Verifying the patch application
...
- All patch related logs are recorded in the
<PRODUCT_HOME>/repository/logs/
file.patches.log
- The
<PRODUCT_HOME>/repository/components/patches/.metadata/prePatchedJARs.txt
meta file contains the list of patched JARs and the md5 values. A list The patch directory information of all the applied service packs and patches are patched will be in the
<PRODUCT_HOME>/repository/components/default/configuration/
prePatchedprePatchedDir.txt
file.Warning Do not change the data in the
<PRODUCT_HOME>/repository/components/default/configuration/prePatchedprePatchedDir.txt
file. The patch application process gets the pre-patched list from this file and compares the list with the patches available in theservicepack
andpatches
directories. If you change the data in this file, you will get a startup error when applying patches.
Overview of the patch application process
...