The release handler process belongs to the
An introduction to release handling and an example is provided in
A release package is a compressed tar file containing
code for a certain version of a release, created by calling
A release package is always to contain:
The
A release package can also contain:
The
The release package can be unpacked, which extracts
the files. An unpacked release can be installed.
The currently used version of the release is then upgraded or
downgraded to the specified version by evaluating the instructions
in the
Each release version has a status, which can be
Status Action NextStatus ------------------------------------------- - unpack unpacked unpacked install current remove - current make_permanent permanent install other old remove - permanent make other permanent old install permanent old reboot_old permanent install current remove -
The release handler process is a locally registered process on each node. When a release is installed in a distributed system, the release handler on each node must be called. The release installation can be synchronized between nodes. From an operator view, it can be unsatisfactory to specify each node. The aim is to install one release package in the system, no matter how many nodes there are. It is recommended that software management functions are written that take care of this problem. Such a function can have knowledge of the system architecture, so it can contact each individual release handler to install the package.
For release handling to work properly, the runtime system must
know which release it is running. It
must also be able to change (in runtime) which boot script and
system configuration file are to be used if the system is
restarted. This is taken care of automatically if Erlang is
started as an embedded system. Read about this in
The installation of a new release can restart the system. Which
program to use is specified by the
The emulator restart on Windows NT expects that the system is
started using the
The release handler at a node running on a diskless machine,
or with a read-only file system, must be configured accordingly
using the following
This node uses some master nodes to store and fetch release information. All master nodes must be operational whenever release information is written by this node.
The
This parameter specifies if the Erlang emulator is statically installed at the client node. A node with a static emulator cannot dynamically switch to a new emulator, as the executable files are statically written into memory.
The release handler can also be used to unpack and install release packages when not running Erlang as an embedded system. However, in this case the user must somehow ensure that correct boot scripts and configuration files are used if the system must be restarted.
Functions are provided for using another file structure than the structure defined in OTP. These functions can be used to test a release upgrade locally.
Checks if the specified version
Evaluates all instructions that occur before
the
Returns the same as
If option
Creates an initial
Installs a release-dependent file in the release structure.
The release-dependent file must be in
the release structure when a new release is installed:
The function can be called, for example, when these files
are generated at the target. The function is to be called after
Installs the specified version
If a script is found, the first thing that happens is that
the application specifications are updated according to
the
After the application specifications have been updated,
the instructions in the script are evaluated and the function
returns
If
If a recoverable error occurs, the function returns
Options:
Defines if the node is to be
restarted
(
Defines the time-out
for all calls to
Defines the time-out for
all calls to
Indicates if all
application code paths are to be updated (
Example:
In the current version
release_handler:set_unpacked(RelFile, [{myapp,"1.0","/home/user"},...]).
=> {ok,NewVsn}
If
Installing a new release can be time consuming if there are many processes in the system. The reason is that each process must be checked for references to old code before a module can be purged. This check can lead to garbage collections and copying of data.
To speed up the execution of
This does not reduce the overall time for the upgrade, but it allows checks and purge to be executed in the background before the real upgrade is started.
When upgrading the emulator from a version older than OTP
R15, an attempt is made to load new application beam
code into the old emulator. Sometimes the new beam
format cannot be read by the old emulator, so the code
loading fails and the complete upgrade is terminated. To
overcome this problem, the new application code is to be
compiled with the old emulator. For more information about
emulator upgrade from pre OTP R15 versions, see
Makes the specified release version
Removes a release and its files from the system. The release must not be the permanent release. Removes only the files and directories not in use by another release.
Reboots the system by making the old release permanent, and
calls
Makes it possible to handle removal of releases outside the release handler. Tells the release handler that the release is removed from the system. This function does not delete any files.
Makes it possible to handle unpacking of releases outside
the release handler. Tells the release handler that
the release is unpacked.
Unpacks a release package
Performs some checks on the package, for example, checks that all mandatory files are present, and extracts its contents.
Returns all releases known to the release handler.
Returns all releases, known to the release handler, of a specific status.
The following functions can be used to test upgrade and downgrade
of single applications (instead of upgrading/downgrading an entire
release). A script corresponding to the instructions in the
These functions are primarily intended for simplified testing
of
No persistent information is updated, so these functions can be used on any Erlang node, embedded or not. Also, using these functions does not affect which code is loaded if there is a reboot.
If the upgrade or downgrade fails, the application can end up in an inconsistent state.
Upgrades an application
The function looks in the
Returns one of the following:
If the
Downgrades an application
The function looks in the
Returns one of the following:
Tries to find an application upgrade script for
The upgrade script can then be evaluated using
The function looks in the
Returns
Failure: If a script cannot be found, the function fails with an appropriate error reason.
Tries to find an application downgrade script for
The downgrade script can then be evaluated using
The function looks in the
Returns
Failure: If a script cannot be found, the function fails with an appropriate error reason.
Evaluates an application upgrade or downgrade script
Returns one of the following:
If the
The master nodes
Specified
Specified
Specified
Problems when extracting from a tar file,
Specified release version
Some operation, indicated by the term
Cannot find a script for upgrading/downgrading between
The directory
The path
The path
The specified release version
Some file operation failed for
Some file operation failed, as for the previous item in the list.