From: Zbigniew Jędrzejewski-Szmek Date: Sat, 30 Mar 2013 20:33:55 +0000 (-0400) Subject: nspawn, machine-id-setup: warn if read-only mount call fails X-Git-Tag: v201~123 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=10d18763ec6f31ded1535f810be765f7fab2d97d;p=elogind.git nspawn, machine-id-setup: warn if read-only mount call fails They are not crucial, but they shouldn't fail. --- diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c index ca163978f..146c5653c 100644 --- a/src/core/machine-id-setup.c +++ b/src/core/machine-id-setup.c @@ -235,7 +235,9 @@ int machine_id_setup(void) { log_info("Installed transient /etc/machine-id file."); /* Mark the mount read-only */ - mount(NULL, "/etc/machine-id", NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, NULL); + if (mount(NULL, "/etc/machine-id", NULL, + MS_BIND|MS_RDONLY|MS_REMOUNT, NULL) < 0) + log_warning("Failed to make transient /etc/machine-id read-only"); } finish: diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 9268cbc24..b8b692b47 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -537,8 +537,8 @@ static int setup_boot_id(const char *dest) { if (mount(from, to, "bind", MS_BIND, NULL) < 0) { log_error("Failed to bind mount boot id: %m"); r = -errno; - } else - mount(from, to, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL); + } else if (mount(from, to, "bind", MS_BIND|MS_REMOUNT|MS_RDONLY, NULL)) + log_warning("Failed to make boot id read-only: %m"); unlink(from); return r;