]> err.no Git - systemd/commitdiff
mount: imply noauto for mount points configured with native mount files
authorLennart Poettering <lennart@poettering.net>
Wed, 25 Aug 2010 19:24:21 +0000 (21:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 25 Aug 2010 19:24:21 +0000 (21:24 +0200)
src/mount.c
src/swap.c

index 08d5de28d7ebc54ee5a3b37f6a09d7c90211eecd..5d5857f5af5680cdb1e97fa8f724beb900248857 100644 (file)
@@ -266,7 +266,11 @@ static int mount_add_target_links(Mount *m) {
                 return unit_add_two_dependencies(tu, UNIT_AFTER, UNIT_WANTS, UNIT(am), true);
         } else {
 
-                if (!noauto && handle)
+                /* Automatically add mount points that aren't natively
+                 * 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;
index 69ccd3db6c965d9c5b0aeb91d15fc5ba6123bc1e..0beb9212ea7cbb075255b4eaa8d5e2d099f54941 100644 (file)
@@ -113,7 +113,10 @@ static int swap_add_target_links(Swap *s) {
         if ((r = manager_load_unit(s->meta.manager, SPECIAL_SWAP_TARGET, NULL, NULL, &tu)) < 0)
                 return r;
 
-        if (!p->noauto && (p->handle || s->meta.manager->swap_auto) && s->meta.manager->running_as == MANAGER_SYSTEM)
+        if (!p->noauto &&
+            (p->handle || s->meta.manager->swap_auto) &&
+            !s->from_fragment &&
+            s->meta.manager->running_as == MANAGER_SYSTEM)
                 if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(s), true)) < 0)
                         return r;