From: David Sommerseth Date: Wed, 6 Sep 2017 23:52:02 +0000 (+0200) Subject: systemd: Enable systemd's auto-restart feature for server profiles X-Git-Tag: v2.4.4~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c112c38d46207905bff97969cf787baada59711;p=thirdparty%2Fopenvpn.git systemd: Enable systemd's auto-restart feature for server profiles Systemd supervises services it has started and can act upon unexpected scenarios. This change will restart OpenVPN after 5 seconds if the OpenVPN process exits unexpectedly. The on-failure mode is the recommended mode by upstream systemd. This change have been tested on a test server for some month, and it works indeed as intended when provoking the OpenVPN process to stop. Signed-off-by: David Sommerseth Acked-by: David Sommerseth Message-Id: <20170906235202.26551-1-davids@openvpn.net> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15370.html Signed-off-by: David Sommerseth (cherry picked from commit a4686e99b047081f0ef6f7945450183088464aa5) --- diff --git a/distro/systemd/openvpn-server@.service.in b/distro/systemd/openvpn-server@.service.in index b343868a9..a8366a04d 100644 --- a/distro/systemd/openvpn-server@.service.in +++ b/distro/systemd/openvpn-server@.service.in @@ -18,6 +18,8 @@ DeviceAllow=/dev/net/tun rw ProtectSystem=true ProtectHome=true KillMode=process +RestartSec=5s +Restart=on-failure [Install] WantedBy=multi-user.target