-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Contrib] Logrotate #9866
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
[Contrib] Logrotate #9866
Conversation
You know there is built in log rotation? It's slightly different from logrotate but it is there. |
Codecov Report
@@ Coverage Diff @@
## master #9866 +/- ##
=========================================
Coverage ? 42.28%
=========================================
Files ? 605
Lines ? 79248
Branches ? 0
=========================================
Hits ? 33507
Misses ? 41612
Partials ? 4129 Continue to review full report at Codecov.
|
Don't merge until #9869 feature is available, to let users choose between Gitea's implementation or external tools. |
@zeripath Aha! I overlooked it. |
I'm unsure of merging this PR as-is, as it is pretty generic and other guides on configuring logrotate might be better. Especially since it would need customization based on the specific user setup (some downstream linux distributions have different settings than what is defined on the "install from source page"), and due to that I suspect this may add to confusion about configuration. Maybe a quick "Gitea includes log rotation built-in, but if you want to use logrotate here is the setting you need to disable" (or something along those lines) and you can put it on the logging page: https://docs.gitea.io/en-us/logging-configuration/ |
@techknowlogick For your suggestion I will address on another PR. |
create 0660 git git | ||
sharedscripts | ||
postrotate | ||
systemctl restart gitea.service |
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.
This restart is unnecessary, it's probably enough to enable copytruncate
and remove both the postrotate
and create
options.
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.
No no no,
Many application use restart-after-logrotate technique, and Gitea should too.
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.
That is a recipe for disaster. What if the application fails to restart? You certainly don't want logrotate to be able to cause a service outage.
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.
@silverwind hmm... logrotate
should be blamed
Closing per #9930 |
This PR adds sample
logrotate
configuration and corresponding docs entry.