From 2a8a73ab1666232d14853bbfef1cd3684e5ae2b5 Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:57:08 -0500 Subject: [PATCH 1/2] Set systemd services to automatically restart --- bin/systemd.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/systemd.dart b/bin/systemd.dart index 642c506d..0f67d157 100644 --- a/bin/systemd.dart +++ b/bin/systemd.dart @@ -27,6 +27,8 @@ void main() async { buffer.writeln("[Service]"); buffer.writeln("ExecStart=${program.fullPathToExecutable}"); buffer.writeln("TimeoutStopSec=3"); + buffer.writeln("Restart=on-failure"); + buffer.writeln("RestartSec=1"); buffer.writeln(); buffer.writeln("[Install]"); buffer.writeln("WantedBy=multi-user.target"); From 6c76e35fdc19b2cfbbdc10a25fdefe2d81336dfc Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Sun, 26 Jan 2025 19:23:11 -0500 Subject: [PATCH 2/2] Restart only on success (if the program intended it) --- bin/systemd.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/systemd.dart b/bin/systemd.dart index 0f67d157..63761397 100644 --- a/bin/systemd.dart +++ b/bin/systemd.dart @@ -27,7 +27,7 @@ void main() async { buffer.writeln("[Service]"); buffer.writeln("ExecStart=${program.fullPathToExecutable}"); buffer.writeln("TimeoutStopSec=3"); - buffer.writeln("Restart=on-failure"); + buffer.writeln("Restart=on-success"); buffer.writeln("RestartSec=1"); buffer.writeln(); buffer.writeln("[Install]");