summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-07-04 22:03:46 +0200
committerChristian Poessinger <christian@poessinger.com>2020-07-04 22:18:35 +0200
commit93a2cc132f47c19151743270160252c701a4fa81 (patch)
treeea2bf9a9f4fbb737917af98d26736a1690bdba2f /data
parentb2291c5825c61b769e438db6f5083b06165e72e6 (diff)
downloadvyos-1x-93a2cc132f47c19151743270160252c701a4fa81.tar.gz
vyos-1x-93a2cc132f47c19151743270160252c701a4fa81.zip
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).
Diffstat (limited to 'data')
-rw-r--r--data/templates/ntp/override.conf.tmpl13
1 files changed, 8 insertions, 5 deletions
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