Skip to content

Commit 573617e

Browse files
committed
more permission fixes for anacron, keep in base image as well
1 parent f52572a commit 573617e

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

image/base/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,16 @@ RUN rm -fr /usr/share/man &&\
108108
# this can probably be done, but I worry that people changing PG locales will have issues
109109
# cd /usr/share/locale && rm -fr `ls -d */ | grep -v en`
110110

111-
112111
RUN mkdir -p /etc/runit/3.d
113112

114113
ADD runit-1 /etc/runit/1
115114
ADD runit-1.d-cleanup-pids /etc/runit/1.d/cleanup-pids
116115
ADD runit-1.d-anacron /etc/runit/1.d/anacron
116+
ADD runit-1.d-00-fix-var-logs /etc/runit/1.d/00-fix-var-logs
117117
ADD runit-2 /etc/runit/2
118118
ADD runit-3 /etc/runit/3
119119
ADD boot /sbin/boot
120120

121121
ADD cron /etc/service/cron/run
122122
ADD rsyslog /etc/service/rsyslog/run
123+
ADD cron.d-anacron /etc/cron.d/anacron

image/base/cron.d_anacron

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# this avoids using invoke-rc.d which is bust in image
2+
3+
SHELL=/bin/sh
4+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
5+
6+
30 7 * * * root /usr/sbin/anacron -s >/dev/null
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
mkdir -p /var/log/nginx
3+
chown -R www-data:www-data /var/log/nginx
4+
chown www-data:www-data /var/log/nginx
5+
chown -f syslog:adm /var/log/syslog*
6+
chown -f syslog:adm /var/log/auth.log*
7+
chown -f syslog:adm /var/log/kern.log*

templates/web.template.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ run:
3939
- exec: /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
4040
- exec: /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
4141
- exec: chown -R discourse /home/discourse
42+
# TODO: move to base image (anacron can not be fired up using rc.d)
43+
- exec: rm -f /etc/cron.d/anacron
44+
- file:
45+
path: /etc/cron.d/anacron
46+
contents: |
47+
SHELL=/bin/sh
48+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
49+
50+
30 7 * * * root /usr/sbin/anacron -s >/dev/null
4251
- file:
4352
path: /etc/runit/1.d/copy-env
4453
chmod: "+x"

0 commit comments

Comments
 (0)