about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2022-02-27 07:04:18 +0900
committerDominique Martinet <asmadeus@codewreck.org>2022-02-27 07:20:26 +0900
commit0dadec45d805c31a0cff3d1ea4e0a3e9a357edfe (patch)
treefd909d858c64ef976f9e497dc08836a0496ce2dd /nixos/tests
parent005a18f6bda9376fe8f92b324db4ac05cd5387de (diff)
downloadnixlib-0dadec45d805c31a0cff3d1ea4e0a3e9a357edfe.tar
nixlib-0dadec45d805c31a0cff3d1ea4e0a3e9a357edfe.tar.gz
nixlib-0dadec45d805c31a0cff3d1ea4e0a3e9a357edfe.tar.bz2
nixlib-0dadec45d805c31a0cff3d1ea4e0a3e9a357edfe.tar.lz
nixlib-0dadec45d805c31a0cff3d1ea4e0a3e9a357edfe.tar.xz
nixlib-0dadec45d805c31a0cff3d1ea4e0a3e9a357edfe.tar.zst
nixlib-0dadec45d805c31a0cff3d1ea4e0a3e9a357edfe.zip
logrotate/systemd: add 'minsize = 1M' to wtmp/btmp rotation
align with upstream logrotate which added the minsize rule at some point.
This avoids needlessly rotating the files too often as brought up in
https://github.com/NixOS/nixpkgs/pull/159187#issuecomment-1052426774
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/logrotate.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/tests/logrotate.nix b/nixos/tests/logrotate.nix
index 0f6b59f071d4..5a724d9d6e94 100644
--- a/nixos/tests/logrotate.nix
+++ b/nixos/tests/logrotate.nix
@@ -19,7 +19,8 @@ import ./make-test-python.nix ({ pkgs, ...} : rec {
 
               # wtmp is present in default config.
               "rm -f /var/log/wtmp*",
-              "echo test > /var/log/wtmp",
+              # we need to give it at least 1MB
+              "dd if=/dev/zero of=/var/log/wtmp bs=2M count=1",
 
               # move into the future and rotate
               "date -s 'now + 1 month + 1 day'",