The Mender Client supports multiple ways to customize the update process:
The Mender Client can run pre- and post-install scripts, before and after it writes the root filesystem. However, Mender state scripts are more general and useful than pre/post-install scripts because they run between any state transition, not just (before/after) the install state.
Typical use cases are:
A State script can be run before (Enter) or after (Leave) each of the following states.
Most of the states also have an Error transition which runs if some error occurs while executing any script for the given state.
State scripts run as pre and post-scripts to every state in the Mender state machine shown above. The state in which a given script runs is determined by the script name and index.
Exit codes from a state script can control the execution of the Mender state machine. Depending on the return code from the script, the Mender client will:
The Mender client collects logs during an update. In case of a failure, these logs are sent to the Mender Server. The output from state scripts are included in these logs. This is useful when troubleshooting intermittent update failures.
To learn more, have a look at the tutorial on how to implement State scripts.
Support for customizing the update process is available in all plans. Synchronizing this remotely through the Mender UI is only available on the Enterprise plan. See the Mender features page for an overview of all Mender plans and features.
When creating a software deployment, it is possible to control the update from the Mender UI or an application running locally on the device by telling the Mender client to wait at specific points in the deployment. The deployment can then either continue or rollback from this point at some later time.
See the screenshot below for an example of what is possible.
Common use cases are:
© 2023 Northern.tech AS