Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 1 | [Unit] |
| 2 | Description=Velia is a health tracking for embedded devices running Linux |
| 3 | Requires=multi-user.target |
| 4 | After=multi-user.target |
| 5 | |
| 6 | [Service] |
| 7 | Type=simple |
Tomáš Pecka | 6794a4f | 2020-08-25 15:03:39 +0200 | [diff] [blame^] | 8 | 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' |
Tomáš Pecka | 0b6120d | 2020-08-21 11:21:50 +0200 | [diff] [blame] | 9 | ExecStart=/usr/bin/veliad --log-level=4 |
Tomáš Pecka | 6794a4f | 2020-08-25 15:03:39 +0200 | [diff] [blame^] | 10 | 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' |
Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 11 | PrivateTmp=yes |
| 12 | PrivateDevices=no |
| 13 | ProtectSystem=yes |
| 14 | ProtectHome=yes |
| 15 | Restart=always |
Tomáš Pecka | 6794a4f | 2020-08-25 15:03:39 +0200 | [diff] [blame^] | 16 | RestartSec=10s |
Tomáš Pecka | c589750 | 2020-07-13 16:49:28 +0200 | [diff] [blame] | 17 | LogRateLimitIntervalSec=10 |
| 18 | LogRateLimitBurst=30000 |
| 19 | SyslogLevel=alert |
| 20 | |
| 21 | [Install] |
| 22 | WantedBy=multi-user.target |