diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-05-16 22:46:03 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-05-16 22:46:03 +0200 |
commit | 307e85efbb781ac609b6b3f905ff76b886ddd01e (patch) | |
tree | 75e4aa953b78e5cd8443f5c08ebe05579ee428e8 /src/mount.c | |
parent | man: document a few special units (diff) | |
download | systemd-307e85efbb781ac609b6b3f905ff76b886ddd01e.tar.xz systemd-307e85efbb781ac609b6b3f905ff76b886ddd01e.zip |
mount: add remote-fs.target/local-fs.target Wants links only when running as system instance
Diffstat (limited to '')
-rw-r--r-- | src/mount.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mount.c b/src/mount.c index ec03a52f6a..921984c1c1 100644 --- a/src/mount.c +++ b/src/mount.c @@ -215,7 +215,7 @@ static int mount_add_target_links(Mount *m) { MountParameters *p; Unit *tu; int r; - bool noauto, handle, automount; + bool noauto, handle, automount, user; assert(m); @@ -227,6 +227,7 @@ static int mount_add_target_links(Mount *m) { return 0; noauto = !!mount_test_option(p->options, MNTOPT_NOAUTO); + user = mount_test_option(p->options, "user") || mount_test_option(p->options, "users"); handle = !!mount_test_option(p->options, "comment=systemd.mount"); automount = !!mount_test_option(p->options, "comment=systemd.automount"); @@ -239,7 +240,7 @@ static int mount_add_target_links(Mount *m) { if ((r = manager_load_unit(UNIT(m)->meta.manager, target, NULL, &tu)) < 0) return r; - if (automount) { + if (automount && m->meta.manager->running_as != MANAGER_SESSION) { Unit *am; if ((r = unit_load_related_unit(UNIT(m), ".automount", &am)) < 0) @@ -253,8 +254,9 @@ static int mount_add_target_links(Mount *m) { } else { if (!noauto && handle) - if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(m), true)) < 0) - return r; + if (user || m->meta.manager->running_as != MANAGER_SESSION) + if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(m), true)) < 0) + return r; return unit_add_dependency(UNIT(m), UNIT_BEFORE, tu, true); } |