26 lines
738 B
Desktop File
26 lines
738 B
Desktop File
[Unit]
|
|
Description=Spannung Control Service
|
|
After=network-online.target i2c.service
|
|
Wants=network-online.target
|
|
StartLimitIntervalSec=60s
|
|
StartLimitBurst=3
|
|
|
|
[Service]
|
|
Type=simple
|
|
# Vorprüfung ALS ROOT ausführen
|
|
ExecStartPre=/bin/bash -c 'for i in {1..5}; do /usr/sbin/i2cdetect -y 1 | grep -q 48 && /usr/sbin/i2cdetect -y 1 | grep -q 49 && exit 0; sleep 2; done; exit 1'
|
|
|
|
ExecStart={{TARGET_DIR}}/{{BINARY}}
|
|
WorkingDirectory={{TARGET_DIR}}
|
|
User={{TARGET_USER}}
|
|
Restart=on-failure
|
|
RestartSec=5s
|
|
|
|
# KORREKTUR: Verhindert, dass STRG+C über SSH den Dienst beim Beenden des Logs killt
|
|
KillMode=process
|
|
|
|
StandardOutput=append:{{TARGET_DIR}}/spannung.log
|
|
StandardError=append:{{TARGET_DIR}}/spannung.log
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|