mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-26 10:03:40 +03:00
mount: sort network mounts after network.target by default
This commit is contained in:
parent
f976f3f67c
commit
a55da3cd5e
13
src/mount.c
13
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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user