blob: f2cd48e917b392817c6d666da0baa7dd5b9e0b8b [file] [log] [blame]
[Unit]
Description=Health tracking of the whole system
Requires=multi-user.target cfg-restore-sysrepo.service czechlight-migrate.service sysrepo-ietf-alarms.service
After=multi-user.target cfg-restore-sysrepo.service czechlight-migrate.service sysrepo-ietf-alarms.service
ConditionKernelCommandLine=czechlight
[Service]
Type=simple
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'
ExecStart=/usr/bin/veliad-health --appliance=czechlight-clearfog
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'
Group=sysrepo
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=yes
ProtectHome=yes
Restart=always
RestartSec=10s
LogRateLimitIntervalSec=10
LogRateLimitBurst=30000
SyslogLevel=alert
[Install]
WantedBy=multi-user.target