FIX: Ensure that log files exists in mounted directory.
authorGuo Xiang Tan <tgx_world@hotmail.com>
Mon, 30 Oct 2017 03:58:59 +0000 (11:58 +0800)
committerGuo Xiang Tan <tgx_world@hotmail.com>
Mon, 30 Oct 2017 03:58:59 +0000 (11:58 +0800)
templates/web.template.yml

index 8bfe6daa9fe59aa78260606a9d5d95822168938e..4e2f2f5aa886357cd83f69a075da3feddbd11ae9 100644 (file)
@@ -62,7 +62,7 @@ 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/enable-brotli
      chmod: "+x"
@@ -264,6 +264,7 @@ run:
         fi
         if [[ ! -d /shared/log/rails ]]; then
           mkdir -p /shared/log/rails
+          touch -a /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr}.log
           chown -R discourse:www-data /shared/log/rails
         fi
         if [[ ! -d /shared/uploads ]]; then