35 lines
1.3 KiB
Desktop File
Executable File
35 lines
1.3 KiB
Desktop File
Executable File
## Service Definition
|
|
## Datei gehört in /etc/systemd/system
|
|
## aktivieren dann mit:
|
|
## - sudo systemctl daemon-reload
|
|
## - sudo systemctl enable CanRtDriver.service NICHT AUSFÜHREN!!!
|
|
## - sudo systemctl start CanRtDriver.service NICHT AUSFÜHREN!!!
|
|
## => Service wird über ./scripts/can_link_up.sh gestartet
|
|
##
|
|
## 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
|
|
# 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
|
|
WorkingDirectory=/home/veltmann/Documents/CanRtDriver/bin
|
|
StandardOutput=inherit
|
|
StandardError=inherit
|
|
Restart=always
|
|
#User=veltmann
|
|
# Optional: Group=meinbenutzergruppe
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|