My systemd service file for TeaVPN2 on my pi
Here it is. ``` [Unit] Description=TeaVPN2 After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always ExecStart=/opt/teavpn2/teavpn2 client ExecStartPost=/bin/sh -c 'while true; do if ping -c 1 -w 3 10.5.5.1 > /dev/null; then systemd-notify WATCHDOG=1; sleep 3; else echo ping failed; fi; done &' NotifyAccess=all WatchdogSec=10 [Install] WantedBy=multi-user.target ``` I learned a few things about a systemd service unit today, including the ability to control a service by using a separate watchdog. This is a nice to have feature. I often have a hanging TeaVPN2 connection when network is unstable. Using a watchdog will help quickly restart teavpn2.Created: 2024-04-09 12:52:13, Updated: 2024-04-29 15:44:09, ID: 4830af11-6ced-4d8a-9d10-2f041bd57bdf