]> git.ipfire.org Git - thirdparty/systemd.git/commit
journalctl: use root machine ID for namespaces
authordongshengyuan <545258830@qq.com>
Tue, 14 Jul 2026 11:34:21 +0000 (19:34 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Jul 2026 16:26:46 +0000 (01:26 +0900)
commit3121e14658e98b8fe665f3d6c53fc0dcd12fb461
treeee2837b9e13a90dcf61c33b5888e5a221ccb2708
parent08bebda611e21e56f89e8387b067776679424e98
journalctl: use root machine ID for namespaces

journalctl --root=... --list-namespaces scans the target root's
journal tree, but used the host machine ID when matching namespace
directories.

Reproducer:
  root="$(mktemp -d)"
  mid=11111111111111111111111111111111
  mkdir -p "$root/etc" "$root/var/log/journal/$mid.testns"
  printf '%s\n' "$mid" >"$root/etc/machine-id"
  journalctl --root="$root" --list-namespaces --quiet

Before:
  no output

Follow-up for: 68f66a171398e27280a95e58ae7464219cccaaec.
src/journal/journalctl-misc.c
test/units/TEST-44-LOG-NAMESPACE.sh