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

Add support for hourly logrotate #1043

Merged
merged 2 commits into from Jun 9, 2016
Merged

Add support for hourly logrotate #1043

merged 2 commits into from Jun 9, 2016

Conversation

@tpetr
Copy link
Member

tpetr commented May 18, 2016

Needed for verbose tasks where daily log rotation isn't often enough.

@tpetr tpetr added the hs_staging label May 18, 2016
package com.hubspot.singularity.executor;

public enum SingularityExecutorLogrotateFrequency {
HOURLY("monthly"),

This comment has been minimized.

Copy link
@ssalinas

ssalinas May 18, 2016

Member

meant hourly here?

This comment has been minimized.

Copy link
@tpetr

tpetr May 18, 2016

Author Member

meant to add a comment here -- hourly isn't supported by all versions of logrotate. my intent was to make it run as infrequently as possible (hence monthly) and then manually trigger logrotate by the executor. (open to other options if you have other ideas here)

This comment has been minimized.

Copy link
@ssalinas

ssalinas May 18, 2016

Member

Right, forgot it doesn't actually have an hourly setting. Would it make sense to instead write something to /etc/cron.hourly/? Value probably doesn't matter in either case since it's manually triggered. Then we could let cron do it's thing rather than having the executor worry about it. Just a thought, this way would work too.

This comment has been minimized.

Copy link
@wsorenson

wsorenson May 18, 2016

Contributor

wouldn't it be far simpler if we made this functionality only work with versons of logrotate which support hourly?

This comment has been minimized.

Copy link
@ssalinas

ssalinas May 18, 2016

Member

Should have clarified that comment, logrotate straight up doesn't support hourly (as far as I know). Most places suggest setting things up in cron.hourly or running a command/script manually if you need to rotate more than daily. From man pages:

       Normally, logrotate is run as a daily cron job.  It will not  modify  a
       log  multiple  times  in  one  day unless the criterium for that log is
       based on the log’s size and logrotate is being run multiple times  each
       day, or unless the -f or -force option is used.

This comment has been minimized.

Copy link
@tpetr

tpetr May 18, 2016

Author Member

The more I think about it, the more I think it'd be OK to go down the /etc/cron.hourly/ route. I'll update the PR.

This comment has been minimized.

Copy link
@solomonty

solomonty May 30, 2016

The puppet-logrotate module and newer versions of logrotate support hourly rotation.

We sometimes need to rotate more often than hourly and we create a manual entry in /etc/cron.d with the appropriate schedule and use the -f option.

@ssalinas ssalinas modified the milestone: 0.8.0 May 19, 2016
@tpetr
Copy link
Member Author

tpetr commented May 19, 2016

Updated PR use cron for hourly logrotate, confirmed working in the test cluster.

@tpetr tpetr added the hs_qa label May 19, 2016
@ssalinas ssalinas force-pushed the logrotate-interval branch from 0e65e6e to d56979c May 20, 2016
@tpetr tpetr added the hs_stable label May 20, 2016
@gchomatas

This comment has been minimized.

Copy link
Contributor

gchomatas commented on d56979c May 23, 2016

🚢

@tpetr tpetr added hs_qa hs_stable and removed hs_qa hs_stable labels Jun 9, 2016
@tpetr tpetr merged commit 0478f3b into master Jun 9, 2016
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@ssalinas ssalinas deleted the logrotate-interval branch Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.