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

feat: Add logrotate for log rotation #8

Merged
merged 2 commits into from
Jun 4, 2024
Merged

feat: Add logrotate for log rotation #8

merged 2 commits into from
Jun 4, 2024

Conversation

NucciTheBoss
Copy link
Member

This pull request adds logrotate to the snap build recipe. Logrotate will run once a day at midnight as a oneshot service. If logrotate rotates the logs out, it will send a signal to Slurm to reopen new log files. Pull request also contains complimenting unit tests for the _setup_logrotate method that I added to the install hook.

Misc

Fixes #7

Discovered this bug when I was testing the logrotate-specific bits in the install hook on a test runner.

The path is now run/munge since `run/` is considered more standard,
but `chmod` call was not updated. This caused the install hook to fail.

Signed-off-by: Jason C. Nucciarone <[email protected]>
Signed-off-by: Jason C. Nucciarone <[email protected]>
@NucciTheBoss NucciTheBoss added the enhancement New feature or request label Jun 3, 2024
@NucciTheBoss NucciTheBoss self-assigned this Jun 3, 2024
@NucciTheBoss
Copy link
Member Author

Lint failure is not due to changes in this pull request. Oddly enough, this issue is not reported on my local set up :/

Copy link
Contributor

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Would be nice to figure out why CI fails though 🤔

@NucciTheBoss
Copy link
Member Author

Looks good! Would be nice to figure out why CI fails though 🤔

update_config(...) is too powerful (complex). Odd though as I typically set the cyclomatic complexity to be 15 instead of 10. Something to fix in a subsequent pull request!

@NucciTheBoss NucciTheBoss merged commit ddb78c1 into main Jun 4, 2024
2 of 3 checks passed
@NucciTheBoss NucciTheBoss deleted the add-logrotate branch June 4, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

install hook is broken because of incorrect directory location
2 participants