Service-Start-Script angepasst
This commit is contained in:
@@ -4,14 +4,24 @@
|
||||
## - sudo systemctl daemon-reload
|
||||
## - sudo systemctl enable CanRtDriver.service
|
||||
## - sudo systemctl start CanRtDriver.service
|
||||
##
|
||||
## Device Unit ermitteln mit: systemctl --type=device | grep can0
|
||||
## Ggf. unter 'Requires', 'After' und 'BindsTo' anpassen!
|
||||
|
||||
[Unit]
|
||||
Description=CAN-Bus Treiber für Gegenstromanlage
|
||||
After=network.target
|
||||
#After=network.target
|
||||
# Stellt sicher, dass die CAN-Device Unit gestartet wird
|
||||
Requires=sys-subsystem-net-devices-can0.device
|
||||
# Stellt die Reihenfolge sicher (Start nach der Device Unit)
|
||||
After=network-online.target sys-subsystem-net-devices-can0.device
|
||||
# Optional: Stoppt den Dienst, wenn das Interface offline geht
|
||||
BindsTo=sys-subsystem-net-devices-can0.device
|
||||
|
||||
[Service]
|
||||
# Skript, das wartet, bis das Interface "UP" ist (ersetzen Sie can0 durch Ihren Interface-Namen)
|
||||
#ExecStartPre=/bin/sh -c 'while ! ip link show can0 | grep -q "state UP"; do sleep 1; done'
|
||||
ExecStart=/home/veltmann/Documents/CanRtDriver/bin/CanRtDriver
|
||||
# Oder: ExecStart=/usr/bin/python3 /home/pi/meinprogramm.py
|
||||
WorkingDirectory=/home/veltmann/Documents/CanRtDriver/bin
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
|
||||
Reference in New Issue
Block a user