Files
king-arth-iot-devices/doc/setupAutostart.md
T
2026-10-23 21:41:53 +02:00

1.2 KiB

Autostart applications

sudo nano /etc/systemd/system/SwordMain.service
[Unit]
Description=IoT Service for Sword Station
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=theUser
WorkingDirectory=/home/theUser/SwordMain
ExecStart=/home/theUser/SwordMain/run.sh
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
chmod +x /home/theUser/SwordMain/start.sh
# Reload systemd
sudo systemctl daemon-reload
# Enable the service
sudo systemctl enable SwordMain.service
# start immediately
sudo systemctl start SwordMain.service
# check status
sudo systemctl status SwordMain.service

game $(pwd)/assets -b "mqtts://excaliburs-erben.de:8883" -t "outdoor/king-arthur/sword/" -p "awesomeexodusoutdooradventures" -u "exodususer"

Watchdog

sudo nano /etc/systemd/system/SwordWatchdog.service
[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