]> git.ipfire.org Git - thirdparty/systemd.git/commit
detect-virt: add message at debug level
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 20 Apr 2023 15:42:57 +0000 (17:42 +0200)
committerMike Yuan <me@yhndnzj.com>
Thu, 20 Apr 2023 19:20:24 +0000 (03:20 +0800)
commit08c2f9c626e0f0052d505b1b7e52f335c0fbfa1d
treec432fb99ab9e236ac2a128fb5efb761b7502abf4
parent6b8e90545e918a4653281b3672a873e948f12b65
detect-virt: add message at debug level

Normal users do not have permissions to access /proc/1/root, so
'systemd-detect-virt -r' fails, but the output, even at debug level
is cryptic:

$ SYSTEMD_LOG_LEVEL=debug build/systemd-detect-virt -r
Failed to check for chroot() environment: Permission denied

Let's make this a bit easier to figure out:

$ SYSTEMD_LOG_LEVEL=debug build/systemd-detect-virt -r
Cannot stat /proc/1/root: Permission denied
Failed to check for chroot() environment: Permission denied

I looked over other users of files_same(), and I think in general the message
at debug level is OK for them too.
src/basic/stat-util.c