fix permissions on the log folder on boot
authorSam <sam.saffron@gmail.com>
Tue, 21 Jun 2016 08:28:18 +0000 (18:28 +1000)
committerSam <sam.saffron@gmail.com>
Tue, 21 Jun 2016 08:28:18 +0000 (18:28 +1000)
templates/web.template.yml

index fdd8de820aec487b0aca7528b36c3b3933213f7d..d5a33a69f75045abc7060eb241b1e32e7c9bfd73 100644 (file)
@@ -49,6 +49,16 @@ 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/fix-log-permissions
+     chmod: "+x"
+     contents: |
+       #!/bin/bash
+       # TODO this should be moved into the base image
+       chown -fR www-data:adm /var/log/nginx
+       chown -f syslog:syslog /var/log/syslog*
+       chown -f syslog:syslog /var/log/auth.log*
+       chown -f syslog:adm /var/log/kern.log*
 
   - file:
      path: /etc/runit/1.d/enable-brotli