diff --git a/meshcore-bot.service b/meshcore-bot.service index f9a59ef..0df67e9 100644 --- a/meshcore-bot.service +++ b/meshcore-bot.service @@ -4,6 +4,12 @@ Documentation=https://github.com/agessaman/meshcore-bot After=network.target Wants=network.target +# Restart policy. These belong in [Unit], not [Service] — systemd 230 moved them, +# and it silently ignores them anywhere else. Give up after 3 starts in 60 s so a +# bot that cannot reach its radio lands in `failed` instead of looping forever. +StartLimitIntervalSec=60 +StartLimitBurst=3 + [Service] Type=simple User=meshcore @@ -42,9 +48,5 @@ LimitNOFILE=65536 MemoryMax=1G CPUQuota=200% -# Restart policy -StartLimitInterval=60 -StartLimitBurst=3 - [Install] WantedBy=multi-user.target diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh index 2b39ab8..f019b6c 100755 --- a/scripts/build-deb.sh +++ b/scripts/build-deb.sh @@ -109,6 +109,12 @@ Documentation=https://github.com/agessaman/meshcore-bot After=network.target Wants=network.target +# Restart policy. These belong in [Unit], not [Service] — systemd 230 moved them, +# and it silently ignores them anywhere else. Give up after 3 starts in 60 s so a +# bot that cannot reach its radio lands in `failed` instead of looping forever. +StartLimitIntervalSec=60 +StartLimitBurst=3 + [Service] Type=simple User=meshcore @@ -140,8 +146,6 @@ ReadWritePaths=/var/lib/meshcore-bot LimitNOFILE=65536 MemoryMax=1G CPUQuota=200% -StartLimitInterval=60 -StartLimitBurst=3 [Install] WantedBy=multi-user.target