From: Zbigniew Jędrzejewski-Szmek Date: Tue, 13 Dec 2022 13:38:06 +0000 (+0100) Subject: fstab-generator: use log message that matches reality X-Git-Tag: v253-rc1~282^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F25723%2Fhead;p=thirdparty%2Fsystemd.git fstab-generator: use log message that matches reality We *assume* that when /sys is read-only, we're running in a container. But there can other reasons, for example root is mount ro and nobody has mounted /sys yet, or somebody forgot to add /sys to the list of filesystem not to remount ro in a sandbox. So let's actually say what we know instead of assuming. systemd-fstab-generator was reporting that it's running in a container and I spent a good few minutes trying to figure out why 'systemd-detect-virt -c' disagrees, before noticing that it's just checking a different condition. --- diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index bca2f389c4a..b0ea536eb29 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -671,12 +671,12 @@ static int parse_fstab(bool initrd) { if (path_is_read_only_fs("/sys") > 0) { if (streq(what, "sysfs")) { - log_info("Running in a container, ignoring fstab entry for %s.", what); + log_info("/sys/ is read-only (running in a container?), ignoring fstab entry for %s.", me->mnt_dir); continue; } if (is_device_path(what)) { - log_info("Running in a container, ignoring fstab device entry for %s.", what); + log_info("/sys/ is read-only (running in a container?), ignoring fstab device entry for %s.", what); continue; } }