blob: 2506f851a65de29bfc865bc890cb6e621687811f [file] [log] [blame]
Tomáš Peckac5897502020-07-13 16:49:28 +02001[Unit]
Tomáš Pecka25aae682021-01-27 14:45:57 +01002Description=Health tracking of the whole system
Tomáš Peckac5897502020-07-13 16:49:28 +02003Requires=multi-user.target
4After=multi-user.target
Tomáš Peckaa31ea7c2020-12-03 16:14:31 +01005ConditionKernelCommandLine=czechlight
Tomáš Peckac5897502020-07-13 16:49:28 +02006
7[Service]
8Type=simple
Jan Kundrát5ae67722020-10-29 00:46:10 +01009ExecStartPre=/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áš Pecka25aae682021-01-27 14:45:57 +010010ExecStart=/usr/bin/veliad-health --log-level=4 --appliance=czechlight-clearfog --systemd-ignore-unit=systemd-journal-upload.service
Jan Kundrát5ae67722020-10-29 00:46:10 +010011ExecStopPost=/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áš Peckac5897502020-07-13 16:49:28 +020012PrivateTmp=yes
Tomáš Pecka25aae682021-01-27 14:45:57 +010013PrivateDevices=yes
Tomáš Peckac5897502020-07-13 16:49:28 +020014ProtectSystem=yes
15ProtectHome=yes
16Restart=always
Tomáš Pecka6794a4f2020-08-25 15:03:39 +020017RestartSec=10s
Tomáš Peckac5897502020-07-13 16:49:28 +020018LogRateLimitIntervalSec=10
19LogRateLimitBurst=30000
20SyslogLevel=alert
21
22[Install]
23WantedBy=multi-user.target