Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 1 | [Unit] |
Tomáš Pecka | 25aae68 | 2021-01-27 14:45:57 +0100 | [diff] [blame] | 2 | Description=Health tracking of the whole system |
Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 3 | Requires=multi-user.target |
| 4 | After=multi-user.target |
Tomáš Pecka | a31ea7c | 2020-12-03 16:14:31 +0100 | [diff] [blame] | 5 | ConditionKernelCommandLine=czechlight |
Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 6 | |
| 7 | [Service] |
| 8 | Type=simple |
Jan Kundrát | 5ae6772 | 2020-10-29 00:46:10 +0100 | [diff] [blame] | 9 | ExecStartPre=/bin/sh -c 'for COLOUR in red green blue; do echo none > /sys/class/leds/status:$${COLOUR}/trigger; echo 0 > /sys/class/leds/status:green/brightness; done' |
Tomáš Pecka | 25aae68 | 2021-01-27 14:45:57 +0100 | [diff] [blame] | 10 | ExecStart=/usr/bin/veliad-health --log-level=4 --appliance=czechlight-clearfog --systemd-ignore-unit=systemd-journal-upload.service |
Jan Kundrát | 5ae6772 | 2020-10-29 00:46:10 +0100 | [diff] [blame] | 11 | ExecStopPost=/bin/sh -c 'for COLOUR in red green blue; do echo 0 > /sys/class/leds/status:$$COLOUR/brightness; done; [[ "$EXIT_CODE" == "exited" ]] && COLOUR="green" || COLOUR="red"; echo timer > /sys/class/leds/status:$$COLOUR/trigger; echo 256 > /sys/class/leds/status:$$COLOUR/brightness' |
Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 12 | PrivateTmp=yes |
Tomáš Pecka | 25aae68 | 2021-01-27 14:45:57 +0100 | [diff] [blame] | 13 | PrivateDevices=yes |
Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 14 | ProtectSystem=yes |
| 15 | ProtectHome=yes |
| 16 | Restart=always |
Tomáš Pecka | 6794a4f | 2020-08-25 15:03:39 +0200 | [diff] [blame] | 17 | RestartSec=10s |
Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 18 | LogRateLimitIntervalSec=10 |
| 19 | LogRateLimitBurst=30000 |
| 20 | SyslogLevel=alert |
| 21 | |
| 22 | [Install] |
| 23 | WantedBy=multi-user.target |