You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Place shell scripts representing *health checks* that **MUST NOT FAIL** in the `/etc/greenboot/check/required.d` directory.
14
+
Place shell scripts representing *health checks* that **MAY FAIL** in the `/etc/greenboot/check/wanted.d` directory.
15
+
Place shell scripts you want to run *after* a boot has been declared **successful** in `/etc/greenboot/green.d`.
16
+
Place shell scripts you want to run *after* a boot has been declared **failed** in `/etc/greenboot/red.d`.
6
17
18
+
Unless greenboot is enabled by default in your distribution, enable it by running `systemctl enable greenboot greenboot-healthcheck greenboot-status`.
19
+
It will automatically start during the next boot process and run its checks.
20
+
21
+
When you `ssh` into the machine after that, a boot status message will be shown.
22
+
23
+
Directory structure:
7
24
```
8
25
/etc
9
26
└── greenboot
@@ -14,40 +31,39 @@ The following directory structure is created:
14
31
└── red.d
15
32
```
16
33
17
-
### Custom Health Checks
18
-
You have multiple options to customize greenboot’s health checking behaviour:
19
34
20
-
* Drop scripts representing health checks that MUST NOT FAIL in order to reach a GREEN boot status into `/etc/greenboot/check/required.d`.
21
-
* Drop scripts representing health checks that MAY FAIL into `/etc/greenboot/check/wanted.d`.
22
-
* Create oneshot health check service units that MUST NOT FAIL like the following and drop them into `/etc/systemd/system` (don't forget to `systemctl enable` them afterwards):
35
+
## Health Checks with systemd services
36
+
Overall boot success is measured against `boot-success.target`.
37
+
Ordering of units can be achieved using standard systemd vocabulary.
38
+
39
+
### Required Checks
40
+
Create a oneshot health check service unit that **MUST NOT FAIL**, e.g. `/etc/systemd/system/required-check.service`. Run `systemctl enable required-check` to enable it.
41
+
23
42
```
24
43
[Unit]
25
44
Description=Custom Required Health Check
26
-
Before=greenboot.target
45
+
Before=boot-complete.target
27
46
28
47
[Service]
29
48
Type=oneshot
30
-
ExecStart=/path/to/service
49
+
ExecStart=/usr/libexec/mytestsuite/required-check
31
50
32
51
[Install]
33
-
RequiredBy=greenboot.target
52
+
RequiredBy=boot-complete.target
34
53
```
35
-
* Create oneshot health check service units that MAY FAIL like the following and drop them into `/etc/systemd/system` (don't forget to `systemctl enable` them afterwards):
54
+
55
+
### Wanted Checks
56
+
Create a oneshot health check service unit that **MAY FAIL**, e.g. `/etc/systemd/system/wanted-check.service`. Run `systemctl enable wanted-check` to enable it.
57
+
36
58
```
37
59
[Unit]
38
60
Description=Custom Wanted Health Check
39
-
Before=greenboot.target
61
+
Before=boot-complete.target
40
62
41
63
[Service]
42
64
Type=oneshot
43
-
ExecStart=/path/to/service
65
+
ExecStart=/usr/libexec/mytestsuite/wanted-check
44
66
45
67
[Install]
46
-
WantedBy=greenboot.target
47
-
```
48
-
49
-
### Custom GREEN Status Procedures
50
-
* Drop scripts representing procedures you want to run after a GREEN boot status has been reached into `/etc/greenboot/green.d`.
51
-
52
-
### Custom RED Status Procedures
53
-
* Drop scripts representing procedures you want to run after a RED boot status has been reached into `/etc/greenboot/red.d`.
0 commit comments