summaryrefslogtreecommitdiff
path: root/src/timer.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-16 18:57:21 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-16 18:57:21 +0200
commit6c155fe3d0634f636e76188b378da174ba02ef52 (patch)
treec79ed82e970e5c972ae4a13959dac487315b7a44 /src/timer.c
parent772a599e4f118fd166d83e7476ed867decefba70 (diff)
path,timer: order units after sysinit by default
Diffstat (limited to 'src/timer.c')
-rw-r--r--src/timer.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/timer.c b/src/timer.c
index 0d4ed27bb4..1580478949 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -73,6 +73,18 @@ static int timer_verify(Timer *t) {
return 0;
}
+static int timer_add_default_dependencies(Timer *t) {
+ int r;
+
+ assert(t);
+
+ if (t->meta.manager->running_as == MANAGER_SYSTEM)
+ if ((r = unit_add_two_dependencies_by_name(UNIT(t), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, NULL, true)) < 0)
+ return r;
+
+ return unit_add_two_dependencies_by_name(UNIT(t), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true);
+}
+
static int timer_load(Unit *u) {
Timer *t = TIMER(u);
int r;
@@ -92,9 +104,8 @@ static int timer_load(Unit *u) {
if ((r = unit_add_dependency(u, UNIT_BEFORE, t->unit, true)) < 0)
return r;
- /* Timers shouldn't stay around on shutdown */
if (t->meta.default_dependencies)
- if ((r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true)) < 0)
+ if ((r = timer_add_default_dependencies(t)) < 0)
return r;
}