From b4877a0186b08e85037627f2574b7e606a05d39f Mon Sep 17 00:00:00 2001 From: Zachary Brown Date: Tue, 12 Dec 2023 12:14:43 -0800 Subject: [PATCH] build: add auto-restart functionality to systemd --- build-scripts/deb/cadt@.service | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build-scripts/deb/cadt@.service b/build-scripts/deb/cadt@.service index 5d3764ac..897b8440 100644 --- a/build-scripts/deb/cadt@.service +++ b/build-scripts/deb/cadt@.service @@ -16,6 +16,10 @@ [Unit] Description=CADT +# Stop automatically restarting if 10 failures in 5 minutes +StartLimitIntervalSec=300 +StartLimitBurst=10 + [Service] # Set Chia directory as an environment variable Environment=CHIA_ROOT=/home/%i/.chia/mainnet @@ -27,5 +31,9 @@ ExecStart=/opt/cadt/cadt User=%i Group=%i +# Auto-restart if process stopped outside of systemd +Restart=on-failure +RestartSec=10s + [Install] WantedBy=multi-user.target