From: Grant Slater Date: Tue, 5 Oct 2021 22:59:13 +0000 (+0100) Subject: imagery: fix service name X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/67e61331905f60ed0f9bab64ac57b5c4a5df9f36 imagery: fix service name --- diff --git a/cookbooks/imagery/resources/site.rb b/cookbooks/imagery/resources/site.rb index 6cfea3ea4..699adbacb 100644 --- a/cookbooks/imagery/resources/site.rb +++ b/cookbooks/imagery/resources/site.rb @@ -111,7 +111,7 @@ action :create do action :delete end - systemd_service "mapserv-fcgi-#{new_resource.site}@" do + systemd_service "mapserv-fcgi-#{new_resource.site}" do description "Map server for #{new_resource.site} layer" environment "MS_MAP_PATTERN" => "^/srv/imagery/mapserver/", "=" => "0", @@ -139,6 +139,14 @@ action :create do listen_stream "/run/mapserver-fastcgi/layer-#{new_resource.site}.socket" end + # Ensure service is stopped because otherwise the socket cannot reload + service "mapserv-fcgi-#{new_resource.site}" do + provider Chef::Provider::Service::Systemd + action :nothing + subscribes :stop, "systemd_service[mapserv-fcgi-#{new_resource.site}]" + subscribes :stop, "systemd_socket[mapserv-fcgi-#{new_resource.site}]" + end + systemd_unit "mapserv-fcgi-#{new_resource.site}.socket" do action [:enable, :start] subscribes :restart, "systemd_socket[mapserv-fcgi-#{new_resource.site}]"