summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-05 19:49:38 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-05 19:50:00 +0200
commita55da3cd5ea9d8cb6d7f1490516734fd43d016cb (patch)
tree23863b13d45d53337e9b6820e8710967b10c1f9a
parentf976f3f67ce5140dc0ba48e0c21a91a553905c57 (diff)
mount: sort network mounts after network.target by default
-rw-r--r--src/mount.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mount.c b/src/mount.c
index 3c08baf5cb..fd77516076 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;