blob: f779bf65d53da232c1a73329657499f8c061be33 [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áš 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