Skip to content

[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

Closed
wants to merge 2 commits into from
Closed

Conversation

bagasme
Copy link
Contributor

@bagasme bagasme commented Jan 19, 2020

This PR adds sample logrotate configuration and corresponding docs entry.

@zeripath
Copy link
Contributor

You know there is built in log rotation? It's slightly different from logrotate but it is there.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 19, 2020
@codecov-io
Copy link

codecov-io commented Jan 19, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@20f6acc). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20f6acc...115ca5d. Read the comment docs.

@bagasme
Copy link
Contributor Author

bagasme commented Jan 19, 2020

Don't merge until #9869 feature is available, to let users choose between Gitea's implementation or external tools.

@zeripath
Copy link
Contributor

@bagasme
Copy link
Contributor Author

bagasme commented Jan 20, 2020

@zeripath Aha! I overlooked it.

@techknowlogick
Copy link
Member

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/

@bagasme
Copy link
Contributor Author

bagasme commented Jan 20, 2020

@techknowlogick For your suggestion I will address on another PR.

create 0660 git git
sharedscripts
postrotate
systemctl restart gitea.service
Copy link
Member

@silverwind silverwind Jan 20, 2020

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.

Copy link
Contributor Author

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.

Copy link
Member

@silverwind silverwind Jan 21, 2020

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.

Copy link
Contributor Author

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

@techknowlogick
Copy link
Member

techknowlogick commented Jan 22, 2020

Closing per #9930

@bagasme bagasme deleted the new/logrotate-conf branch January 23, 2020 04:56
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants