]> git.openstreetmap.org Git - chef.git/commitdiff
Restart chef-client by sending TERM and letting systemd restart it
authorTom Hughes <tom@compton.nu>
Mon, 1 May 2017 20:09:31 +0000 (21:09 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 1 May 2017 20:09:31 +0000 (21:09 +0100)
cookbooks/chef/recipes/default.rb

index 2e2e345a11374886d93acdb60e6294c54d8de91e..35ed0d87e6b116ac5cb8c7267d0d96ea210b1d17 100644 (file)
@@ -112,7 +112,6 @@ if node[:lsb][:release].to_f >= 15.10
     description "Chef client"
     after "network.target"
     exec_start "/usr/bin/chef-client -i 1800 -s 20"
-    success_exit_status 3
     restart "on-failure"
   end
 else
@@ -126,6 +125,9 @@ end
 
 service "chef-client" do
   action [:enable, :start]
+  if node[:lsb][:release].to_f >= 15.10
+    restart_command "systemctl kill --signal=TERM chef-client.service"
+  end
   supports :status => true, :restart => true, :reload => true
   subscribes :restart, "dpkg_package[chef]"
   subscribes :restart, "template[/etc/init/chef-client.conf]"