summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-13 21:55:34 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-13 21:55:34 +0200
commit9fcc065a773b3804a84fe27e9089d76bfe0061fa (patch)
tree5760e77df11c328e4252b1268e21e9b8a32d7379
parentd8b4e2e9acb8c68cd46405ae1e9b8fb06cb75269 (diff)
mount: only add those mount points to localfs.target as Wants that are marked for us
-rw-r--r--mount.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mount.c b/mount.c
index d70aaa8218..2e3abcc6bc 100644
--- a/mount.c
+++ b/mount.c
@@ -244,6 +244,8 @@ static int mount_add_target_links(Mount *m) {
MountParameters *p;
Unit *u;
int r;
+ bool noauto;
+ bool handle;
assert(m);
@@ -254,10 +256,10 @@ static int mount_add_target_links(Mount *m) {
else
return 0;
- if (!p->fstype)
- return 0;
+ noauto = mount_test_option(p->options, MNTOPT_NOAUTO);
+ handle = mount_test_option(p->options, "comment=systemd.mount");
- if (mount_test_option(p->options, MNTOPT_NOAUTO))
+ if (noauto && !handle)
return 0;
if (mount_test_option(p->options, "_netdev") ||
@@ -269,8 +271,9 @@ static int mount_add_target_links(Mount *m) {
if ((r = manager_load_unit(UNIT(m)->meta.manager, target, &u)) < 0)
return r;
- if ((r = unit_add_dependency(u, UNIT_WANTS, UNIT(m))) < 0)
- return r;
+ if (handle)
+ if ((r = unit_add_dependency(u, UNIT_WANTS, UNIT(m))) < 0)
+ return r;
return unit_add_dependency(UNIT(m), UNIT_BEFORE, u);
}