From a55da3cd5ea9d8cb6d7f1490516734fd43d016cb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 Oct 2010 19:49:38 +0200 Subject: [PATCH] mount: sort network mounts after network.target by default --- src/mount.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mount.c b/src/mount.c index 3c08baf5..fd775160 100644 --- a/src/mount.c +++ b/src/mount.c @@ -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; -- 2.39.5