summaryrefslogtreecommitdiff
path: root/automount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-06 02:43:58 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-06 02:43:58 +0200
commit23a177ef7c8c38c238ef06666f900f581b48298f (patch)
tree0e1467035854fea1a51c5efad2f69464ac2d402b /automount.c
parent5af98f828476716954f327c479c4cf6321ae3fe4 (diff)
rework merging/loading logic
Diffstat (limited to 'automount.c')
-rw-r--r--automount.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/automount.c b/automount.c
index a45cd96505..c28472da76 100644
--- a/automount.c
+++ b/automount.c
@@ -26,7 +26,7 @@
#include "load-fragment.h"
#include "load-dropin.h"
-static int automount_init(Unit *u) {
+static int automount_init(Unit *u, UnitLoadState *new_state) {
int r;
Automount *a = AUTOMOUNT(u);
@@ -35,13 +35,28 @@ static int automount_init(Unit *u) {
exec_context_init(&a->exec_context);
/* Load a .automount file */
- if ((r = unit_load_fragment(u)) < 0)
+ if ((r = unit_load_fragment(u, new_state)) < 0)
return r;
+ if (*new_state == UNIT_STUB)
+ *new_state = UNIT_LOADED;
+
/* Load drop-in directory data */
- if ((r = unit_load_dropin(u)) < 0)
+ if ((r = unit_load_dropin(unit_follow_merge(u))) < 0)
return r;
+ if (*new_state == UNIT_LOADED) {
+
+ if ((r = unit_add_dependency(u, UNIT_BEFORE, UNIT(a->mount))) < 0)
+ return r;
+
+ if ((r = unit_add_exec_dependencies(u, &a->exec_context)) < 0)
+ return r;
+
+ if ((r = unit_add_default_cgroup(u)) < 0)
+ return r;
+ }
+
return 0;
}