more permission fixes for anacron, keep in base image as well
authorSam <sam.saffron@gmail.com>
Thu, 7 Jul 2016 01:08:20 +0000 (11:08 +1000)
committerSam <sam.saffron@gmail.com>
Thu, 7 Jul 2016 01:08:35 +0000 (11:08 +1000)
image/base/Dockerfile
image/base/cron.d_anacron [new file with mode: 0644]
image/base/runit-1.d-00-fix-var-logs [new file with mode: 0755]
templates/web.template.yml

index f01dfb81a7732a97207b90ed064549e4e02ea93d..16e0fbe79ea3b5f1ec7e20a1fc5cc9bd890f2755 100644 (file)
@@ -108,15 +108,16 @@ RUN   rm -fr /usr/share/man &&\
 # this can probably be done, but I worry that people changing PG locales will have issues
 # cd /usr/share/locale && rm -fr `ls -d */ | grep -v en`
 
-
 RUN mkdir -p /etc/runit/3.d
 
 ADD runit-1 /etc/runit/1
 ADD runit-1.d-cleanup-pids /etc/runit/1.d/cleanup-pids
 ADD runit-1.d-anacron /etc/runit/1.d/anacron
+ADD runit-1.d-00-fix-var-logs /etc/runit/1.d/00-fix-var-logs
 ADD runit-2 /etc/runit/2
 ADD runit-3 /etc/runit/3
 ADD boot /sbin/boot
 
 ADD cron /etc/service/cron/run
 ADD rsyslog /etc/service/rsyslog/run
+ADD cron.d-anacron /etc/cron.d/anacron
diff --git a/image/base/cron.d_anacron b/image/base/cron.d_anacron
new file mode 100644 (file)
index 0000000..0f784a9
--- /dev/null
@@ -0,0 +1,6 @@
+# this avoids using invoke-rc.d which is bust in image
+
+SHELL=/bin/sh
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+30 7    * * *   root   /usr/sbin/anacron -s >/dev/null
diff --git a/image/base/runit-1.d-00-fix-var-logs b/image/base/runit-1.d-00-fix-var-logs
new file mode 100755 (executable)
index 0000000..fda0252
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+mkdir -p /var/log/nginx
+chown -R www-data:www-data /var/log/nginx
+chown www-data:www-data /var/log/nginx
+chown -f syslog:adm /var/log/syslog*
+chown -f syslog:adm /var/log/auth.log*
+chown -f syslog:adm /var/log/kern.log*
index 27136da8de4b148741cac5684300b3f4da7989ce..aec88394cb4c23d4a74325834e31837e2863d943 100644 (file)
@@ -39,6 +39,15 @@ run:
   - exec: /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
   - exec: /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
   - exec: chown -R discourse /home/discourse
+  # TODO: move to base image (anacron can not be fired up using rc.d)
+  - exec: rm -f /etc/cron.d/anacron
+  - file:
+     path: /etc/cron.d/anacron
+     contents: |
+        SHELL=/bin/sh
+        PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+        30 7    * * *   root   /usr/sbin/anacron -s >/dev/null
   - file:
      path: /etc/runit/1.d/copy-env
      chmod: "+x"