summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-03-25 21:20:08 +0100
committerLennart Poettering <lennart@poettering.net>2013-03-25 21:28:30 +0100
commite3d84721dc9bcf9008f72dae03ff0f7842d0bb4b (patch)
tree2f62446a9d8961872060346793f788e3cac366fd /src
parent1b036593b76614dd05942a78120c151161cccc0f (diff)
units: introduce new timers.target and paths.target to hook timer/path units into for boot
Diffstat (limited to 'src')
-rw-r--r--src/core/path.c10
-rw-r--r--src/core/service.c10
-rw-r--r--src/core/socket.c10
-rw-r--r--src/core/special.h2
-rw-r--r--src/core/timer.c8
5 files changed, 27 insertions, 13 deletions
diff --git a/src/core/path.c b/src/core/path.c
index 295e5cdf0e..ff49c069ee 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -361,12 +361,12 @@ static int path_add_default_dependencies(Path *p) {
assert(p);
- if (UNIT(p)->manager->running_as == SYSTEMD_SYSTEM) {
- r = unit_add_dependency_by_name(UNIT(p), UNIT_BEFORE,
- SPECIAL_BASIC_TARGET, NULL, true);
- if (r < 0)
- return r;
+ r = unit_add_dependency_by_name(UNIT(p), UNIT_BEFORE,
+ SPECIAL_PATHS_TARGET, NULL, true);
+ if (r < 0)
+ return r;
+ if (UNIT(p)->manager->running_as == SYSTEMD_SYSTEM) {
r = unit_add_two_dependencies_by_name(UNIT(p), UNIT_AFTER, UNIT_REQUIRES,
SPECIAL_SYSINIT_TARGET, NULL, true);
if (r < 0)
diff --git a/src/core/service.c b/src/core/service.c
index fa8a1cb039..98266a5a90 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1148,6 +1148,16 @@ static int service_add_default_dependencies(Service *s) {
SPECIAL_SOCKETS_TARGET, NULL, true);
if (r < 0)
return r;
+
+ r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES,
+ SPECIAL_TIMERS_TARGET, NULL, true);
+ if (r < 0)
+ return r;
+
+ r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES,
+ SPECIAL_PATHS_TARGET, NULL, true);
+ if (r < 0)
+ return r;
}
/* Second, activate normal shutdown */
diff --git a/src/core/socket.c b/src/core/socket.c
index a3e3631dac..31f4bf49b6 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -331,11 +331,13 @@ static int socket_add_default_dependencies(Socket *s) {
int r;
assert(s);
- if (UNIT(s)->manager->running_as == SYSTEMD_SYSTEM) {
- if ((r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SOCKETS_TARGET, NULL, true)) < 0)
- return r;
+ r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SOCKETS_TARGET, NULL, true);
+ if (r < 0)
+ return r;
- if ((r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, NULL, true)) < 0)
+ if (UNIT(s)->manager->running_as == SYSTEMD_SYSTEM) {
+ r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, NULL, true);
+ if (r < 0)
return r;
}
diff --git a/src/core/special.h b/src/core/special.h
index c7b856e2bd..ad873a9c31 100644
--- a/src/core/special.h
+++ b/src/core/special.h
@@ -46,6 +46,8 @@
/* Early boot targets */
#define SPECIAL_SYSINIT_TARGET "sysinit.target"
#define SPECIAL_SOCKETS_TARGET "sockets.target"
+#define SPECIAL_TIMERS_TARGET "timers.target"
+#define SPECIAL_PATHS_TARGET "paths.target"
#define SPECIAL_LOCAL_FS_TARGET "local-fs.target"
#define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target"
#define SPECIAL_INITRD_FS_TARGET "initrd-fs.target"
diff --git a/src/core/timer.c b/src/core/timer.c
index d98468fd9e..16b49174d3 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -96,11 +96,11 @@ static int timer_add_default_dependencies(Timer *t) {
assert(t);
- if (UNIT(t)->manager->running_as == SYSTEMD_SYSTEM) {
- r = unit_add_dependency_by_name(UNIT(t), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true);
- if (r < 0)
- return r;
+ r = unit_add_dependency_by_name(UNIT(t), UNIT_BEFORE, SPECIAL_TIMERS_TARGET, NULL, true);
+ if (r < 0)
+ return r;
+ if (UNIT(t)->manager->running_as == SYSTEMD_SYSTEM) {
r = unit_add_two_dependencies_by_name(UNIT(t), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, NULL, true);
if (r < 0)
return r;