chiark / gitweb /
shutdown: recursively mark root as private before pivot
authorDave Reisner <dreisner@archlinux.org>
Fri, 10 Aug 2012 15:02:03 +0000 (11:02 -0400)
committerLennart Poettering <lennart@poettering.net>
Fri, 10 Aug 2012 15:59:33 +0000 (17:59 +0200)
Because root is now recursively marked as shared on bootup, we need to
recursively mark root as private. This prevents a pivot_root failure on
shutdown:

  Cannot finalize remaining file systems and devices, giving up.
  pivot failed: Invalid argument

src/core/shutdown.c

index 105a604542b001cb760a66ff404b978e58f970d0..0b7cbd8d3410e52ee13e7dca9877610a477b00a4 100644 (file)
@@ -109,7 +109,7 @@ static int pivot_to_new_root(void) {
           It works for pivot_root, but the ref count for the root device
           is not decreasing :-/
         */
-        if (mount(NULL, "/", NULL, MS_PRIVATE, NULL) < 0) {
+        if (mount(NULL, "/", NULL, MS_REC|MS_PRIVATE, NULL) < 0) {
                 log_error("Failed to make \"/\" private mount %m");
                 return -errno;
         }