[systemd-bugs] [Bug 56837] New: Enable custom path to be ignored on shutdown umount cycle

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 7 01:03:54 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=56837

          Priority: medium
            Bug ID: 56837
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: Enable custom path to be ignored on shutdown umount
                    cycle
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: major
    Classification: Unclassified
                OS: Linux (All)
          Reporter: aleksei.lissitsin at gmail.com
          Hardware: x86-64 (AMD64)
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

In systemd it should be possible to specify which mountpoints must not be
unmounted on shutdown.

I have the following setup:
Archlinux (guest) is installed into a file on an ntfs partition (host).

Initrd mounts the host (say, /dev/sda2) into its (initrd's) filesystem using
an executable whose name starts with @ (so that the process would not be killed
by systemd on shutdown).

Then initrd creates a loop device using the file on the host and proceeds to
start the guest using it as the root device.

But I still want to access the host from the guest, so initrd bind-mounts
the host to a path in guest's filesystem (I cannot mount it later from guest
because /dev/sda2 would be busy as already mounted).

This causes /dev/sda2 to appear in guest's mountinfo, so that systemd will try
(and succeed) to unmount it while there are still some processes writing to
guest's filesystem. --> BAD THINGS HAPPEN THEN

I currently solve the issue by the following patch 
(my host is mounted to /host in guest filesystem)

--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -127,7 +127,7 @@ bool mount_point_ignore(const char *path) {
                 if (path_equal(path, i))
                         return true;

-        return false;
+        return path_startswith(path, "/host");
 }

 static int mount_one(const MountPoint *p, bool relabel) {

But I think that using predefined prefixes is not the best solution and systemd
should allow one to somehow specify exactly which mountpoints not to unmount on
shutdown.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20121107/825c56e7/attachment.html>


More information about the systemd-bugs mailing list