Only restart chef-client after log rotation if it is running
authorTom Hughes <tom@compton.nu>
Fri, 21 Oct 2016 17:28:41 +0000 (18:28 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 21 Oct 2016 17:28:41 +0000 (18:28 +0100)
cookbooks/chef/templates/default/logrotate.erb

index d953395..21d0eb6 100644 (file)
@@ -6,7 +6,7 @@
   compress
   postrotate
 <% if node[:lsb][:release].to_f >= 15.10 -%>
-       systemctl restart chef-client.service
+       systemctl try-restart chef-client.service
 <% else -%>
        restart chef-client > /dev/null
 <% end -%>