]> git.ipfire.org Git - thirdparty/systemd.git/commit
tmpfiles: inherit age-by for X entries 43031/head
authordongshengyuan <545258830@qq.com>
Wed, 15 Jul 2026 05:35:57 +0000 (13:35 +0800)
committerdongshengyuan <545258830@qq.com>
Fri, 24 Jul 2026 05:44:37 +0000 (13:44 +0800)
commit3cc7ccc02ccef09c0c751287176e0006dbe205a1
treed40eceef0a0401501e01bc598d7deef1040048cf
parentc56420a362fb5ec47105606bc1b7363951ef1698
tmpfiles: inherit age-by for X entries

X entries inherit the cleanup age from the closest parent directory rule.
Inherit the age-by fields too, so parent rules such as m:1d keep their
full cleanup policy.

Reproducer:
  mkdir -p /tmp/tmpfiles-ageby/parent/{child,other}
  printf old >/tmp/tmpfiles-ageby/parent/child/file
  printf old >/tmp/tmpfiles-ageby/parent/other/file
  touch -d '3 days ago' /tmp/tmpfiles-ageby/parent/{child,other}/file
  systemd-tmpfiles --clean - <<'EOT'
  d /tmp/tmpfiles-ageby/parent - - - m:1d
  X /tmp/tmpfiles-ageby/parent/child - - - -
  EOT

Before:
  child/file remained because X used the default age-by set.
  other/file was removed by the parent m: rule.

Follow-up for 7f7a50dd157b3bfb4282c3cc3a56671121eabe24.
src/tmpfiles/tmpfiles.c
test/units/TEST-22-TMPFILES.12.sh