]> git.openstreetmap.org Git - chef.git/commitdiff
imagery: fix service name
authorGrant Slater <git@firefishy.com>
Tue, 5 Oct 2021 22:59:13 +0000 (23:59 +0100)
committerGrant Slater <git@firefishy.com>
Tue, 5 Oct 2021 22:59:13 +0000 (23:59 +0100)
cookbooks/imagery/resources/site.rb

index 6cfea3ea4c01381ad01863bba3c6b1aaed987096..699adbacbdfd82d07a4a40ff3c1c2a3c6c80c7a2 100644 (file)
@@ -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}]"