-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
missingok | ||
notifempty | ||
compress | ||
delaycompress | ||
sharedscripts | ||
postrotate | ||
invoke-rc.d rsyslog rotate > /dev/null |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
service rsyslog rotate >/dev/null 2>&1 || true
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/etc/init.d/rsyslog rotate > /dev/null
was solved this problem to me some time ago, not sure about now.
* src/sonic-utilities ee56d54...cb0e745 (11): > sonic_utilities: Support for DOM Threshold values for EEPROM dump (#545) > [portstat] Fix portstat show RX_UTIL over 100% for 100G (#563) > sonic_installer: fix read-only filesystem support for firmware update (#565) > Revert "show acl table command output should show binding column correctly even with single port (#447)" (#589) > show acl table command output should show binding column correctly even with single port (#447) > [config] Do no stop or restart dependent services (#582) > sfpshow: prevent 'show int trans eeprom --dom' from crashing (#567) > [warm-reboot] add docker upgrade --warm option and roll back support (#559) > [ecnconfig] Validate input WRED parameters (#579) > [sonic-utilities] Add fstrim to reboot (#535) > Fixing the expected neighbor command due to change in output format under sonic-buildimage/pull/3036 (#584)
Signed-off-by: Harish Venkatraman <[email protected]>
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (sonic-net#535) [Kamil Cudnik] Signed-off-by: Guohan Lu <[email protected]>
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (#535) [Kamil Cudnik] Signed-off-by: Guohan Lu <[email protected]>
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (sonic-net#535) [Kamil Cudnik] Signed-off-by: Guohan Lu <[email protected]>
* Pospone QueueMap initialization until activation of counters * Generate queue maps only for front panel ports * Create empty buffer lists by default
[schema] Add EXP to TC map config table (sonic-net#537) [CI]: Swap the python code coverage report with the cpp report (sonic-net#544) Remove SWIG generated files from coverage report (sonic-net#542) Update database defintions for PINs / P4Runtime (sonic-net#536) [ci]: Support code coverage (sonic-net#539) Fix the option missing in kernel config issue (sonic-net#541) Add SRV6 APP tables (sonic-net#538) [schema] Rename CBF config tables (sonic-net#535)
[schema] Add EXP to TC map config table (#537) [CI]: Swap the python code coverage report with the cpp report (#544) Remove SWIG generated files from coverage report (#542) Update database defintions for PINs / P4Runtime (#536) [ci]: Support code coverage (#539) Fix the option missing in kernel config issue (#541) Add SRV6 APP tables (#538) [schema] Rename CBF config tables (#535)
rsyslog logs were being rotated regardless of whether they exceeded their maixmum size. This was due to "-f" flag passed to logrotate in cron job.
After rotation, /var/log/syslog was never written to again. Instead, logs were written to /var/log/syslog.1. This was due to rsyslog not properly closing the file descriptor to the pre-rotated log.
Also addresses issue systemd-journald[224]: [/etc/systemd/journald.conf:21] Failed to parse size value, ignoring: #528
Also brought back time-related rotation via the new(er)
maxsize
option, which performs a boolean OR operation. If the log exceeds the maxsize OR the log hasn't been rotated in the specified, it will be rotated. Using the oldersize
option, the time-based rotation was ignored.