From 070b926ff501a79266507a6b5d80ad08784141da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damien=20Pl=C3=A9nard?= Date: Tue, 23 Jul 2019 11:56:21 +0200 Subject: [PATCH 1/2] update systemd service update the systemd service with the service file from nomad official repository --- templates/nomad.systemd.erb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/nomad.systemd.erb b/templates/nomad.systemd.erb index 139d1d7..689a198 100644 --- a/templates/nomad.systemd.erb +++ b/templates/nomad.systemd.erb @@ -1,6 +1,7 @@ [Unit] Description=Nomad agent -Requires=network-online.target +Documentation=https://nomadproject.io/docs/ +Wants=network-online.target After=network-online.target [Service] @@ -9,8 +10,13 @@ Restart=on-failure ExecStart=<%= scope.lookupvar('nomad::bin_dir') %>/nomad agent -config=<%= scope.lookupvar('nomad::config_dir') %> <%= scope.lookupvar('nomad::extra_options') %> ExecReload=/bin/kill -HUP $MAINPID KillSignal=SIGINT -RestartSec=42s -LimitNOFILE=131072 +RestartSec=2 +LimitNOFILE=65536 +LimitNPROC=infinity +KillMode=process +StartLimitBurst=3 +StartLimitIntervalSec=10 +TasksMax=infinity [Install] WantedBy=multi-user.target \ No newline at end of file From ae0019d283f0ed4eeb145216857158fb3369b6a3 Mon Sep 17 00:00:00 2001 From: Damien PLENARD Date: Tue, 23 Jul 2019 16:05:31 +0200 Subject: [PATCH 2/2] move StartLimit to unit instead of system --- templates/nomad.systemd.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/nomad.systemd.erb b/templates/nomad.systemd.erb index 689a198..0cbcb95 100644 --- a/templates/nomad.systemd.erb +++ b/templates/nomad.systemd.erb @@ -3,6 +3,8 @@ Description=Nomad agent Documentation=https://nomadproject.io/docs/ Wants=network-online.target After=network-online.target +StartLimitBurst=3 +StartLimitIntervalSec=10 [Service] EnvironmentFile=-/etc/sysconfig/nomad @@ -14,9 +16,7 @@ RestartSec=2 LimitNOFILE=65536 LimitNPROC=infinity KillMode=process -StartLimitBurst=3 -StartLimitIntervalSec=10 TasksMax=infinity [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target