[Backport release-26.05] nixos/logrotate: Fix the config file check phase regex for create/createolddir (#526234)

This commit is contained in:
Kim Lindberger 2026-05-31 15:57:59 +00:00 committed by GitHub
commit 952b742444
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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 = {