allow nginx logs to be read by the web
authorSam <sam.saffron@gmail.com>
Fri, 26 Jun 2015 02:33:50 +0000 (12:33 +1000)
committerSam <sam.saffron@gmail.com>
Fri, 26 Jun 2015 02:33:50 +0000 (12:33 +1000)
templates/web.template.yml

index d0b7519ef6fe2991a9e084a0816aaa3822dd0bbf..2ff14832587da2f9d4d71cfb6934faec260cafbd 100644 (file)
@@ -33,6 +33,13 @@ run:
         # find DISCOURSE_ env vars, strip the leader, lowercase the key
         /usr/local/bin/ruby -e 'ENV.each{|k,v| puts "#{$1.downcase} = #{v}" if k =~ /^DISCOURSE_(.*)/}' > $conf
 
+  - file:
+      path: /etc/runit/1.d/ensure-web-nginx-read
+      chmod: "+x"
+      contents: |
+        #!/bin/bash
+        chgrp -R www-data /var/log/nginx
+        chgrp www-data /var/log/nginx
   - file:
      path: /etc/service/unicorn/run
      chmod: "+x"
@@ -199,7 +206,7 @@ run:
           compress
           delaycompress
           notifempty
-          create 0640 www-data adm
+          create 0640 www-data www-data
           sharedscripts
           postrotate
             sv 1 nginx