Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[System logs]: Fix logrotate bugs #535

Merged
merged 3 commits into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/image_config/cron.d/logrotate
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Attempt to rotate system logs once per minute
* * * * * root /usr/sbin/logrotate -f /etc/logrotate.d/rsyslog
* * * * * root /usr/sbin/logrotate /etc/logrotate.d/rsyslog

12 changes: 5 additions & 7 deletions files/image_config/logrotate.d/rsyslog
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
/var/log/teamd.log
{
rotate 7
# Removed 'daily' interval, as we now call logrotate more frequently via cron
# and we want to check these logs every time
# daily
size 100M
daily
maxsize 100M
missingok
notifempty
compress
delaycompress
postrotate
invoke-rc.d rsyslog rotate > /dev/null
kill -HUP $(cat /var/run/rsyslogd.pid)
endscript
}
/var/log/mail.info
Expand All @@ -30,14 +28,14 @@
{
rotate 4
weekly
size 100M
maxsize 100M
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
invoke-rc.d rsyslog rotate > /dev/null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvoke-rc.d rsyslog rotate > /dev/null [](start = 9, length = 37)

in /etc/init.d/rsyslog, rotate is doing the kill HUP. why not use invoke-rc.d rsyslog rotate?

Copy link
Contributor Author

@jleveque jleveque Apr 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not working properly. It was confirmed as a bug present in our version of init-system-helpers: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672218.

There seem to be two workarounds:

  1. service rsyslog rotate >/dev/null 2>&1 || true
  2. kill -HUP $(cat /var/run/rsyslogd.pid)

I have tested the latter solution. I did not try the former, as the || true seems a bit hacky. I can test it if you'd like.

kill -HUP $(cat /var/run/rsyslogd.pid)
endscript
}

4 changes: 2 additions & 2 deletions files/image_config/systemd/journald.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#SyncIntervalSec=5m
#RateLimitInterval=30s
#RateLimitBurst=1000
SystemMaxUse=50MB
SystemMaxUse=50M
#SystemKeepFree=
#SystemMaxFileSize=
RuntimeMaxUse=50MB
RuntimeMaxUse=50M
#RuntimeKeepFree=
#RuntimeMaxFileSize=
#MaxRetentionSec=
Expand Down