blob: 3db86356e537c4c8f9ddb9cb66cdaf2aede185f2 [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
5
6[Service]
7Type=simple
Tomáš Pecka6794a4f2020-08-25 15:03:39 +02008ExecStartPre=/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áš Pecka0b6120d2020-08-21 11:21:50 +02009ExecStart=/usr/bin/veliad --log-level=4
Tomáš Pecka6794a4f2020-08-25 15:03:39 +020010ExecStopPost=/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 +020011PrivateTmp=yes
12PrivateDevices=no
13ProtectSystem=yes
14ProtectHome=yes
15Restart=always
Tomáš Pecka6794a4f2020-08-25 15:03:39 +020016RestartSec=10s
Tomáš Peckac5897502020-07-13 16:49:28 +020017LogRateLimitIntervalSec=10
18LogRateLimitBurst=30000
19SyslogLevel=alert
20
21[Install]
22WantedBy=multi-user.target