blob: 5eb6fc5616e8bdea5f49bf5cdeaabe919e25799e [file] [log] [blame]
Tomáš Peckac5897502020-07-13 16:49:28 +02001[Unit]
2Description=Velia is a health tracking for embedded devices running Linux
3Requires=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áš Peckaa31ea7c2020-12-03 16:14:31 +010010ExecStart=/usr/bin/veliad --log-level=4 --systemd-ignore-unit=systemd-journal-upload.service --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áš Peckac5897502020-07-13 16:49:28 +020012PrivateTmp=yes
13PrivateDevices=no
14ProtectSystem=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