Merge pull request #162022 from martinetd/logrotate
logrotate/systemd: add 'minsize = 1M' to wtmp/btmp rotation
This commit is contained in:
commit
3743b4979b
2 changed files with 4 additions and 1 deletions
|
@ -1224,6 +1224,7 @@ in
|
|||
keep = 1;
|
||||
extraConfig = ''
|
||||
create 0660 root ${config.users.groups.utmp.name}
|
||||
minsize 1M
|
||||
'';
|
||||
};
|
||||
"/var/log/wtmp" = mapAttrs (_: mkDefault) {
|
||||
|
@ -1231,6 +1232,7 @@ in
|
|||
keep = 1;
|
||||
extraConfig = ''
|
||||
create 0664 root ${config.users.groups.utmp.name}
|
||||
minsize 1M
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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'",
|
||||
|
|
Loading…
Reference in a new issue