Skip to content

Commit 5f0d4b7

Browse files
author
Marissa Zhang
committed
Improve logrotate parameters based on Mat's feedback
1 parent dd35c9c commit 5f0d4b7

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

Dockerfile.testing

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ RUN pip3 install -U pip && pip3 install -r /opt/registry/requirements.txt
2828
# Use our weird grid-security cert/key location
2929
RUN rm /etc/httpd/conf.d/ssl.conf
3030

31-
# Setup cron job for logrotate to run every 5 minutes
32-
RUN crontab -l | { cat; echo "* * * * * /usr/sbin/logrotate /etc/logrotate.d/httpd >> /var/log/cron 2>&1"; } | crontab -
31+
# Setup cron job for logrotate to run as root every day
32+
RUN echo "0 0 * * * root /usr/sbin/logrotate /etc/logrotate.d/httpd >> /var/log/cron 2>&1" > /etc/cron.d/logrotate-httpd
3333

3434
COPY register.py /usr/bin
3535
COPY supervisor-apache.conf /etc/supervisord.d/40-apache.conf

logrotate-http.conf

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/var/log/httpd/*.log {
2-
maxsize 10K
3-
dateext
4-
dateformat -%Y%m%d-%s
5-
rotate 2
2+
maxsize 100M
3+
rotate 20
64
missingok
75
notifempty
86
compress
97
delaycompress
108
sharedscripts
119
postrotate
12-
PID=$(pgrep -o httpd) && kill -USR1 $PID
10+
PID=$(pgrep -o httpd); if [ "$PID" ]; then kill -USR1 $PID; fi
1311
endscript
1412
}

0 commit comments

Comments
 (0)