-
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]: Improvements to prevent filling /var/log partition #865
Conversation
jleveque
commented
Aug 4, 2017
•
edited
Loading
edited
- Force log rotation at size thresholds only (no longer also rotating logs daily), allowing for more consistent archived log size
- Eliminate remaining duplicate log messages
- Cron facility now only logs to cron.log (was also logging to syslog)
- Debug, mail, news and user log facilities only log to syslog; no longer creating separate log files for these facilities
- Cron job that calls logrotate every minute now uses the main /etc/logrotate.conf file so as to check/rotate all logs every minute, not just the logs specified in the rsyslog file. Also redirecting output of this command to /dev/null to prevent "(CRON) info (No MTA installed, discarding output)" messages in cron.log due to lack of a mail service
- Delete archive files based on remaining /var/log partition space. Note that this solution currently requires a minimum /var/log partition size of 32MB to function correctly
- Update sonic-sairedis and sonic-swss submodules to incorporate recording file name changes
- Add .screen file to .gitignore (unrelated)
…ing filename changes
/var/log/swss/sairedis.rec | ||
/var/log/swss/swss.rec | ||
{ | ||
size 512k |
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.
I wonder if 1M would be better, resulting less log files.
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.
I agree it would result in less log files total. However, I was trying to find a balance between reasonable log file size and supporting as small a partition as possible, while also maximizing the used space of smaller partitions.
Increasing the file size to 1M will increase the minimum /var/log partition size to ~32MB, but will require that we maintain ~20MB free space to ensure we always keep at least one archived copy of each log and have enough free space to potentially fill all logs before the next rotation (vs. a minimum partition size of ~18MB maintaining ~12MB free space with 512k files). If you don't see a problem with this, I will make the change and test it ASAP.
* msft_github/master: [docker-fpm-quagga]: Manage Quagga processes (zebra, bgpd) using supervisor instead of watchquagga (sonic-net#900) Add arista-net initramfs hook (sonic-net#899) Add Marvell platform (sonic-net#765) [sonic-utilities]: Update submodule to remove pager from CLI utils (sonic-net#897) Fixing a couple of issues to enable FRR to run with latest SONiC code. (sonic-net#895) Fix the network command for ipv6 vlan interfaces (sonic-net#894) Add s8810 32q platform support (sonic-net#867) [quagga]: Update sonic-quagga submodule (sonic-net#892) [docker-database]: Start rsyslogd to allow supervisor to log to syslog (sonic-net#890) [docker-platform-monitor]: Prevent supervisor from logging unexpected exits from processes known to exit in < 1 second (sonic-net#889) Update sonic-utilities (sonic-net#887) [submodule] update sonic-swss submodule (sonic-net#885) [LEDs]: Initialize status and fan LEDs to green on Arista 7050-QX-32/7050-QX-32-S (sonic-net#886) [sfputil]: Add support for SFP presence, low-power mode and reset (sonic-net#877) [System logs]: Improvements to prevent filling /var/log partition (sonic-net#865) Update sonic-utilities pointer to support reload minigraph (sonic-net#871) [device/accton]: Update Accton-AS7712-32X (sonic-net#776) [ConfigDB] Move all BGP configuration into DB (sonic-net#861) [sonic-slave]: Split user commands from generic. (sonic-net#868) [platform] Add support for Arista DCS-7260CX3-64 (sonic-net#863)
* src/sonic-utilities 798ce2f...7ce5b62 (19): > [utility] Filter FDB entries (#890) > [fast reboot] set a fast-reboot DB flag (#887) > [show] Add 'ip/ipv6 bgp network' commands (#888) > [Vxlan] : adding show vnet/vxlan cmds (#880) > [show][bgp] Use only 'show ip bgp' as the base and use bgp_frr_v4 file for FRR routing stack (#884) > Revert "[config] Implement a process level lock (#857)" (#882) > [generate_dump] Dump systemd specific information (#602) > [config] Implement a process level lock (#857) > [fwutil]: Update Command-Reference.md. (#876) > Add platform options to 'show techsupport' command (#865) > [doc]: add ltgm and jenkins badge (#875) > Fix even more Python warnings (#873) > [showtech]: dump docker stats (#864) > Fix more Python warnings (#869) > Fix Python warnings (#867) > Fixes bug for PFCWD feature parameters (#838) > Explicitly specify command names with underscores (continued) (#852) > [watermarkstat] Fix issue of fields overwritten before display (#862) > [pfc] Add command line to enable/disable/show PFC (#796)
Signed-off-by: Shlomi Bitton <shlomibi@mellanox.com>
Added logrotate file for wtmp and btmp to override default conf and set size cap as 100K as done in PR: #865. For buster this is control by separate file wtmp and btmp. Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Added logrotate file for wtmp and btmp to override default conf and set size cap as 100K as done in PR: #865. For buster this is control by separate file wtmp and btmp. Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Added logrotate file for wtmp and btmp to override default conf and set size cap as 100K as done in PR: #865. For buster this is control by separate file wtmp and btmp. Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
…onic-net#865) Signed-off-by: kcudnik <kcudnik@gmail.com>