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

openrc: Add logrotate support for openrc systems #523

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

Kawanaao
Copy link
Contributor

Optional logrotate support for openrc based systems that have logrotate

@Kawanaao
Copy link
Contributor Author

Fully tested on my system, the configuration files perform the task, the only question is the size of the log files, if according to #521 the log size within the normal range will be lower than 50 MB

reading config file /etc/logrotate.d/scx
acquired lock on state file /var/lib/misc/logrotate.status
Reading state from file: /var/lib/misc/logrotate.status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state

Handling 1 logs

rotating pattern: /var/log/scx/*.log 1048576 bytes empty log files are not rotated, only log files >= 4194304 bytes are rotated, no old logs will be kept
considering log /var/log/scx/scx.log
  Now: 2024-08-20 19:36
  Last rotated at 2024-08-20 19:35
  log needs rotating
rotating log /var/log/scx/scx.log, log->rotateCount is 0
dateext suffix '-20240820'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/scx/scx.log.1 to /var/log/scx/scx.log.2 (rotatecount 1, logstart 1, i 1), 
old log /var/log/scx/scx.log.1 does not exist
log /var/log/scx/scx.log.2 doesn't exist -- won't try to dispose of it
skip copying /var/log/scx/scx.log to /var/log/scx/scx.log.1
truncating /var/log/scx/scx.log

@Kawanaao Kawanaao marked this pull request as ready for review August 20, 2024 16:37
@htejun htejun merged commit 2d449f3 into sched-ext:main Aug 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants