// Module included in the following assemblies:
//
// * microshift_install_get_ready/microshift-greenboot.adoc

:_mod-docs-content-type: CONCEPT
[id="microshift-greenboot-directories-details_{context}"]
= Greenboot directories details

[role="_abstract"]
You can control how greenboot handles errors by placing your health check scripts in specific directories. The directories determine which scripts are strictly required for a successful boot and which ones can fail without causing a rollback.

Returning a nonzero exit code from any script means that script has failed. Greenboot restarts the system a few times to retry the scripts before attempting to roll back to the previous version.

* `/etc/greenboot/check/required.d` contains the health checks that must not fail.

** If the scripts fail, greenboot retries them three times by default. You can configure the number of retries in the `/etc/greenboot/greenboot.conf` file by setting the `GREENBOOT_MAX_BOOTS` parameter to the desired number of retries.

** After all retries fail, greenboot automatically initiates a rollback if one is available. If a rollback is not available, the system log output shows that manual intervention is required.

** The `40_microshift_running_check.sh` health check script for {microshift-short} is installed into this directory.

* `/etc/greenboot/check/wanted.d` contains health scripts that are allowed to fail without causing the system to be rolled back.

** If any of these scripts fail, greenboot logs the failure but does not initiate a rollback.

* `/etc/greenboot/green.d` contains scripts that run after greenboot has declared the start successful.

* `/etc/greenboot/red.d` contains scripts that run after greenboot has declared the startup as failed, including the `40_microshift_pre_rollback.sh` prerollback script. This script is executed right before a system rollback. The script performs {microshift-short} pod and OVN-Kubernetes cleanup to avoid potential conflicts after the system is rolled back to a previous version.

[IMPORTANT]
====
If you customize the values of any environment variable in the `/etc/greenboot/greenboot.conf` file, these changes can be lost when the greenboot RPM package is updated or downgraded.

* To retain customizations when building system images with {microshift-short}, add the `greenboot.conf` file to a blueprint.
* To retain customizations when using an RPM installation, apply changes to the `greenboot.conf` file after you install {microshift-short} and greenboot RPMs.
====
