From c2e56f41e0fe2d9e1c0f034365cfc9998b8b734a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 23 Jun 2020 22:37:44 +0100 Subject: [PATCH] Delay trying to start squid until the end of the run This ensures that all config fragments have been updated before we try and start it, allowing recovery from breakage. --- cookbooks/squid/recipes/default.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cookbooks/squid/recipes/default.rb b/cookbooks/squid/recipes/default.rb index eb3876428..ff2a6a425 100644 --- a/cookbooks/squid/recipes/default.rb +++ b/cookbooks/squid/recipes/default.rb @@ -106,12 +106,17 @@ systemd_service "squid" do end service "squid" do - action [:enable, :start] + action :enable subscribes :restart, "systemd_service[squid]" subscribes :restart, "template[/etc/squid/squid.conf]" subscribes :reload, "template[/etc/resolv.conf]" end +notify_group "squid-start" do + action :run + notifies :start, "service[squid]" +end + service "squid-restart" do service_name "squid" action :restart -- 2.39.5