From 0c60ce0930f8da2ac4e2ec6c7b3ee91cf90fe56c Mon Sep 17 00:00:00 2001 From: Clemens Zagler Date: Mon, 2 Dec 2024 09:31:54 +0100 Subject: [PATCH] systemd restart caddy service on unexpected shutdown --- files/caddy.service | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/caddy.service b/files/caddy.service index 2667e80..c233fe4 100644 --- a/files/caddy.service +++ b/files/caddy.service @@ -32,5 +32,10 @@ PrivateTmp=true ProtectSystem=full AmbientCapabilities=CAP_NET_BIND_SERVICE +# Auto restart in case of unexpected shutdown (e.g. when killed due to OOM-condition) +RestartPreventExitStatus=1 +Restart=on-failure +RestartSec=5s + [Install] WantedBy=multi-user.target