From 93a2cc132f47c19151743270160252c701a4fa81 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 4 Jul 2020 22:03:46 +0200 Subject: ntp: vrf: T2682: support restart on failure indefinitely Linux tries to bind sshd to the VRF but it is yet not ready - for any arbitrary reason. After restarting SSH to often (rate-limiting) it is blocked by systemd. Using Restart/RestartSec is not enough - systemd services use start rate limiting (enabled by default). If service is started more than StartLimitBurst times in StartLimitIntervalSec seconds is it not permitted to start any more. Parameters are inherited from DefaultStartLimitIntervalSec (default 10s) and DefaultStartLimitBurst (default 5). --- data/templates/ntp/override.conf.tmpl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'data/templates/ntp/override.conf.tmpl') diff --git a/data/templates/ntp/override.conf.tmpl b/data/templates/ntp/override.conf.tmpl index 69a73b128..466638e5a 100644 --- a/data/templates/ntp/override.conf.tmpl +++ b/data/templates/ntp/override.conf.tmpl @@ -1,8 +1,11 @@ +{% set vrf_command = '/sbin/ip vrf exec ' + vrf + ' ' if vrf is defined else '' %} +[Unit] +StartLimitIntervalSec=0 +After=vyos-router.service + [Service] ExecStart= -{% if vrf %} -ExecStart=/sbin/ip vrf exec {{ vrf }} /usr/lib/ntp/ntp-systemd-wrapper -{% else %} -ExecStart=/usr/lib/ntp/ntp-systemd-wrapper -{% endif %} +ExecStart={{vrf_command}}/usr/lib/ntp/ntp-systemd-wrapper +Restart=on-failure +RestartSec=10 -- cgit v1.2.3