chiark / gitweb /
timer: when deserializing timer state stay elapsed when we are elapsed
[elogind.git] / src / mount.c
index 3fc0f1371657f689687e5029cf10f5905187e8d1..0b67fbed5d5d035a4c95cb7ad9d2951ef28ebae1 100644 (file)
@@ -70,6 +70,9 @@ static void mount_init(Unit *u) {
          * already trying to comply its last one. */
         m->exec_context.same_pgrp = true;
 
+        /* Make sure we unmount when the devices we require go away */
+        m->meta.stop_retroactively = true;
+
         m->timer_watch.type = WATCH_INVALID;
 
         m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID;
@@ -265,7 +268,7 @@ static int mount_add_target_links(Mount *m) {
         MountParameters *p;
         Unit *tu;
         int r;
-        bool noauto, handle, automount, user;
+        bool noauto, handle, automount;
 
         assert(m);
 
@@ -277,7 +280,6 @@ static int mount_add_target_links(Mount *m) {
                 return 0;
 
         noauto = !!mount_test_option(p->options, MNTOPT_NOAUTO);
-        user = mount_test_option(p->options, "user") || mount_test_option(p->options, "users");
         handle = !!mount_test_option(p->options, "comment=systemd.mount") ||
                 m->meta.manager->mount_auto;
         automount = !!mount_test_option(p->options, "comment=systemd.automount");
@@ -311,10 +313,10 @@ static int mount_add_target_links(Mount *m) {
                  * configured to local-fs.target */
                 if (!noauto &&
                     handle &&
-                    !m->from_fragment)
-                        if (user || m->meta.manager->running_as == MANAGER_SYSTEM)
-                                if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(m), true)) < 0)
-                                        return r;
+                    m->from_etc_fstab &&
+                    m->meta.manager->running_as == MANAGER_SYSTEM)
+                        if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(m), true)) < 0)
+                                return r;
 
                 return unit_add_dependency(UNIT(m), UNIT_BEFORE, tu, true);
         }