blob: 05f66c22c0b97f78e9ac33c5882a9613e44e88a9 [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'
Václav Kubernát0dde5042021-02-12 11:09:46 +010010ExecStart=/usr/bin/veliad-health --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áš Peckad3861ce2022-05-11 11:51:30 +020012Group=sysrepo
Tomáš Peckac5897502020-07-13 16:49:28 +020013PrivateTmp=yes
Tomáš Pecka25aae682021-01-27 14:45:57 +010014PrivateDevices=yes
Tomáš Peckac5897502020-07-13 16:49:28 +020015ProtectSystem=yes
16ProtectHome=yes
17Restart=always
Tomáš Pecka6794a4f2020-08-25 15:03:39 +020018RestartSec=10s
Tomáš Peckac5897502020-07-13 16:49:28 +020019LogRateLimitIntervalSec=10
20LogRateLimitBurst=30000
21SyslogLevel=alert
22
23[Install]
24WantedBy=multi-user.target