mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
[Backport release-26.05] nixos/logrotate: Fix the config file check phase regex for create/createolddir (#526234)
This commit is contained in:
commit
952b742444
2 changed files with 5 additions and 3 deletions
|
|
@ -91,9 +91,9 @@ let
|
|||
# files required to exist also won't be present, so missingok is forced.
|
||||
user=$(${pkgs.buildPackages.coreutils}/bin/id -un)
|
||||
group=$(${pkgs.buildPackages.coreutils}/bin/id -gn)
|
||||
sed -e "s/\bsu\s.*/su $user $group/" \
|
||||
-e "s/\b\(create\s\+[0-9]*\s*\|createolddir\s\+[0-9]*\s\+\).*/\1$user $group/" \
|
||||
-e "1imissingok" -e "s/\bnomissingok\b//" \
|
||||
sed -E -e "s/\bsu\s.*/su $user $group/" \
|
||||
-e "s/\b((create|createolddir)\b(\s+[0-9]+)?).*/\1 $user $group/" \
|
||||
-e "1imissingok" -e "s/\bnomissingok\b//" \
|
||||
$out > logrotate.conf
|
||||
# Since this makes for very verbose builds only show real error.
|
||||
# There is no way to control log level, but logrotate hardcodes
|
||||
|
|
|
|||
|
|
@ -66,8 +66,10 @@ in
|
|||
checkConf = {
|
||||
su = "root utmp";
|
||||
createolddir = "0750 root utmp";
|
||||
"createolddir " = "0750";
|
||||
create = "root utmp";
|
||||
"create " = "0750 root utmp";
|
||||
"create " = "0750";
|
||||
};
|
||||
# multiple paths should be aggregated
|
||||
multipath = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue