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

[System logs]: Fix logrotate bugs #535

merged 3 commits into from
Apr 25, 2017

Conversation

jleveque
Copy link
Contributor

  • 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 older size option, the time-based rotation was ignored.

@jleveque jleveque self-assigned this Apr 24, 2017
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.

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

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

as comments

Copy link
Contributor

@NStetskovych-zz NStetskovych-zz left a 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.

@jleveque jleveque merged commit f28790c into sonic-net:master Apr 25, 2017
@jleveque jleveque deleted the syslog_fixes branch April 25, 2017 00:55
lguohan pushed a commit that referenced this pull request Jul 31, 2019
* 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)
Kalimuthu-Velappan pushed a commit to Kalimuthu-Velappan/sonic-buildimage that referenced this pull request Sep 12, 2019
Signed-off-by: Harish Venkatraman <harish_venkatraman@dell.com>
lguohan added a commit to lguohan/sonic-buildimage that referenced this pull request Nov 22, 2019
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (sonic-net#535) [Kamil Cudnik]

Signed-off-by: Guohan Lu <gulv@microsoft.com>
lguohan added a commit that referenced this pull request Nov 22, 2019
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (#535) [Kamil Cudnik]

Signed-off-by: Guohan Lu <gulv@microsoft.com>
zhenggen-xu pushed a commit to zhenggen-xu/sonic-buildimage that referenced this pull request Jan 10, 2020
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (sonic-net#535) [Kamil Cudnik]

Signed-off-by: Guohan Lu <gulv@microsoft.com>
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
* Pospone QueueMap initialization until activation of counters

* Generate queue maps only for front panel ports

* Create empty buffer lists by default
dmytroxshevchuk pushed a commit to dmytroxshevchuk/sonic-buildimage that referenced this pull request Aug 31, 2020
TACappleman added a commit to Metaswitch/sonic-buildimage that referenced this pull request Oct 27, 2021
[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)
lguohan pushed a commit that referenced this pull request Oct 28, 2021
[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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants