]> err.no Git - systemd/commitdiff
mount: sort network mounts after network.target by default
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Oct 2010 17:49:38 +0000 (19:49 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Oct 2010 17:50:00 +0000 (19:50 +0200)
src/mount.c

index 3c08baf5cb132577cfa2e74a7657cfe860199fb2..fd77516076659b196f3740bd152fcded8154fa91 100644 (file)
@@ -260,7 +260,7 @@ static char* mount_test_option(const char *haystack, const char *needle) {
 }
 
 static int mount_add_target_links(Mount *m) {
-        const char *target;
+        const char *target, *after = NULL;
         MountParameters *p;
         Unit *tu;
         int r;
@@ -282,14 +282,21 @@ static int mount_add_target_links(Mount *m) {
         automount = !!mount_test_option(p->options, "comment=systemd.automount");
 
         if (mount_test_option(p->options, "_netdev") ||
-            fstype_is_network(p->fstype))
+            fstype_is_network(p->fstype)) {
                 target = SPECIAL_REMOTE_FS_TARGET;
-        else
+
+                if (m->meta.manager->running_as == MANAGER_SYSTEM)
+                        after = SPECIAL_NETWORK_TARGET;
+        } else
                 target = SPECIAL_LOCAL_FS_TARGET;
 
         if ((r = manager_load_unit(m->meta.manager, target, NULL, NULL, &tu)) < 0)
                 return r;
 
+        if (after)
+                if ((r = unit_add_dependency_by_name(tu, UNIT_AFTER, after, NULL, true)) < 0)
+                        return r;
+
         if (automount && m->meta.manager->running_as == MANAGER_SYSTEM) {
                 Unit *am;