Skip to content

logrotate: do not enable logrotate.service itself#161929

Merged
dasJ merged 2 commits intoNixOS:masterfrom
martinetd:switchTest
Feb 28, 2022
Merged

logrotate: do not enable logrotate.service itself#161929
dasJ merged 2 commits intoNixOS:masterfrom
martinetd:switchTest

Conversation

@martinetd
Copy link
Member

@martinetd martinetd commented Feb 26, 2022

logrotate.timer is enough for rotating logs. Enabling logrotate.service would
make the service start on every configuration switch, leading to tests failure when
logrotate is enabled.
Also update test to make sure the timer is active and runs the service
on date change.

supersedes #161859 as a fix for testSwitch, I've taken the second commit that was unrelated as well...
cc @ncfavier @vcunat @dasJ

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 26, 2022
@martinetd
Copy link
Member Author

@ofborg test switchTest

@martinetd
Copy link
Member Author

@ofborg test logrotate

Copy link
Member

@ncfavier ncfavier left a comment

Choose a reason for hiding this comment

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

Great!

martinetd and others added 2 commits February 26, 2022 19:13
logrotate.timer is enough for rotating logs. Enabling logrotate.service would
make the service start on every configuration switch, leading to tests failure when
logrotate is enabled.

Also update test to make sure the timer is active and runs the service
on date change.
Currently the test-watch.service gets started in a loop as long as
/testpath exists, so `rm /testpath /testpath-modified` runs into a race
condition where if the service was just getting activated, it will
create /testpath-modified and make the test fail.

This is fixed by making the service RemainAfterExit so that it only
starts once, and stopping it manually after we remove /testpath.
@martinetd
Copy link
Member Author

martinetd commented Feb 26, 2022

(force push just now updated commit message of first commit, sorry I just noticed non-sense ('for what rotating' had extra what). Content is identical so I'm not re-triggering ofborg, feel free to if that's appropriate)

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Feb 26, 2022
@ncfavier ncfavier added the 1.severity: channel blocker Blocks a channel label Feb 26, 2022
@vcunat
Copy link
Member

vcunat commented Feb 26, 2022

I confirm that this version of test succeeds reliably on my machine.

It still feels like this particular tests is (and was) very expensive to evaluate, but that would belong to a different discussion thread and I don't have energy for it anyway.

@martinetd martinetd mentioned this pull request Feb 27, 2022
5 tasks
@martinetd
Copy link
Member Author

I didn't do the legwork to check but if nixos-unstable is really blocked on this should it be merged? The channel has been stuck for 6 days and I'd rather not be responsible for too many delayed security fixes... (and that'll perhaps teach me that such defaults changes should go to staging even if it looked harmless, sorry for the trouble that caused :()

@ncfavier
Copy link
Member

Right now the channel is also not evaluating, but yes this should be merged ASAP

@dasJ dasJ merged commit d32ba3f into NixOS:master Feb 28, 2022
@martinetd martinetd deleted the switchTest branch March 14, 2022 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.severity: channel blocker Blocks a channel 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants