From 2da36a071fdf7e941ec80992ec939bd412b3bd20 Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Sun, 14 Feb 2021 17:51:56 +0100 Subject: [PATCH] systemd: restart l2tpns on failure When a l2tpns cluster gets out of a "split brain" situation, l2tpns will consider that it is not normal to having multiple master, and some members of the cluster will voluntarily kill themselves. While this is probably the best thing to do for l2tpns in this situation, continued operation is important. Let's tell systemd to restart l2tpns in such cases. Looking at the code, there are several other places where l2tpns might exit in case of grave failure, and this change will also cover these cases. --- scripts/l2tpns.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/l2tpns.service b/scripts/l2tpns.service index f62686a..64dafd7 100644 --- a/scripts/l2tpns.service +++ b/scripts/l2tpns.service @@ -7,6 +7,8 @@ Documentation=man:l2tpns(8) man:startup-config(5) EnvironmentFile=-/etc/default/l2tpns ExecStart=/usr/sbin/l2tpns $L2TPNS_OPTS ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure +RestartSec=5s [Install] WantedBy=multi-user.target