]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/imagery/templates/default/mapserv_fcgi.conf.erb
Imagery - Fix url_aliases
[chef.git] / cookbooks / imagery / templates / default / mapserv_fcgi.conf.erb
index 9f6e250932e8bd3c2bf816fd0ffa238d260c181d..5615d3c001341fc70992d4a75aa4afa204da0dd3 100644 (file)
@@ -9,21 +9,25 @@ stop on runlevel [!2345]
 
 respawn
 
-setuid imagery
-setgid imagery
-
 limit nofile 16384 16384
 
 # https://trac.osgeo.org/mapserver/wiki/EnvironmentVariables
-env MS_MAPFILE="/srv/imagery/mapserver/layer-<%= @name %>.map"
+env MS_MAPFILE="/srv/imagery/mapserver/layer-<%= @layer %>.map"
 env MS_MAP_PATTERN="^/srv/imagery/mapserver/"
-env MS_ERRORFILE="/tmp/mapserver-layer-<%= @name %>.log"
+env MS_ERRORFILE="/tmp/mapserver-layer-<%= @layer %>.log"
 env MS_DEBUGLEVEL="5"
 
+pre-start script
+    mkdir -p -m 0775 /var/run/mapserver-fastcgi
+    chown imagery:imagery /var/run/mapserver-fastcgi
+end script
+
 script
     exec /usr/bin/spawn-fcgi \
         -n \
-        -s /var/run/mapserver-fastcgi/layer-<%= @name %>.socket \
+        -u imagery \
+        -g imagery \
+        -s /var/run/mapserver-fastcgi/layer-<%= @layer %>.socket \
         -M 0666 \
         -f /usr/lib/cgi-bin/mapserv
 end script