step: Watchdog

This commit is contained in:
Gustice committed 2026-10-23 21:41:53 +02:00
1 parent 27a791c4c0
commit 85e2e92991
4 files changed
+136 -12

No files matched your search

+35 -11
View File
@@ -1,20 +1,20 @@
# Autostart applications
```sh
sudo nano /etc/systemd/system/Sword.service
sudo nano /etc/systemd/system/SwordMain.service
```
./
```ini
[Unit]
Description=My Raspberry Pi Application
Description=IoT Service for Sword Station
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=gustice
WorkingDirectory=/home/pi/SwordMain
ExecStart=bash start.sh
User=theUser
WorkingDirectory=/home/theUser/SwordMain
ExecStart=/home/theUser/SwordMain/run.sh
Restart=on-failure
RestartSec=5
@@ -23,16 +23,40 @@ WantedBy=multi-user.target
```
```sh
chmod +x /home/pi/SwordMain/start.sh
chmod +x /home/theUser/SwordMain/start.sh
# Reload systemd
sudo systemctl daemon-reload
# Enable the service
sudo systemctl enable Sword.service
sudo systemctl enable SwordMain.service
# start immediately
sudo systemctl start Sword.service
sudo systemctl start SwordMain.service
# check status
sudo systemctl status Sword.service
sudo systemctl status SwordMain.service
```
game $(pwd)/assets -b "mqtts://excaliburs-erben.de:8883" -t "outdoor/king-arthur/sword/" -p "awesomeexodusoutdooradventures" -u "exodususer"
game $(pwd)/assets -b "mqtts://excaliburs-erben.de:8883" -t "outdoor/king-arthur/sword/" -p "awesomeexodusoutdooradventures" -u "exodususer"
## Watchdog
```sh
sudo nano /etc/systemd/system/SwordWatchdog.service
```
```ini
[Unit]
Description=Network Watchdog for Sword
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
# user root user
WorkingDirectory=/home/theUser/SwordWatchdog
ExecStart=/home/theUser/SwordWatchdog/watchdog.py
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
```