blob: f2cd48e917b392817c6d666da0baa7dd5b9e0b8b [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áš Peckab31a0892023-07-19 11:12:29 +02003Requires=multi-user.target cfg-restore-sysrepo.service czechlight-migrate.service sysrepo-ietf-alarms.service
4After=multi-user.target cfg-restore-sysrepo.service czechlight-migrate.service sysrepo-ietf-alarms.service
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áš Peckabaf3e862022-10-03 16:59:05 +020010ExecStart=/usr/bin/veliad-health --appliance=czechlight-clearfog
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