From: Lennart Poettering Date: Fri, 29 Oct 2010 04:04:03 +0000 (+0200) Subject: units: order units by default before appropriate targets in case they are pulled... X-Git-Tag: v12~98 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a77d31df976c3934e3b38a9e61c000ec9a8acc2;p=systemd units: order units by default before appropriate targets in case they are pulled indirectly --- diff --git a/src/automount.c b/src/automount.c index 462f3170..b45cbcf5 100644 --- a/src/automount.c +++ b/src/automount.c @@ -154,6 +154,9 @@ static int automount_add_default_dependencies(Automount *a) { if (a->meta.manager->running_as == MANAGER_SYSTEM) { + if ((r = unit_add_dependency_by_name(UNIT(a), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true)) < 0) + return r; + if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0) return r; } diff --git a/src/path.c b/src/path.c index 1d6f98cf..f62157e8 100644 --- a/src/path.c +++ b/src/path.c @@ -106,9 +106,13 @@ static int path_add_default_dependencies(Path *p) { assert(p); - if (p->meta.manager->running_as == MANAGER_SYSTEM) + if (p->meta.manager->running_as == MANAGER_SYSTEM) { + if ((r = unit_add_dependency_by_name(UNIT(p), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true)) < 0) + return r; + if ((r = unit_add_two_dependencies_by_name(UNIT(p), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, NULL, true)) < 0) return r; + } return unit_add_two_dependencies_by_name(UNIT(p), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true); } diff --git a/src/socket.c b/src/socket.c index 6d2df958..9662066c 100644 --- a/src/socket.c +++ b/src/socket.c @@ -301,9 +301,13 @@ static int socket_add_default_dependencies(Socket *s) { int r; assert(s); - if (s->meta.manager->running_as == MANAGER_SYSTEM) + if (s->meta.manager->running_as == MANAGER_SYSTEM) { + if ((r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SOCKETS_TARGET, NULL, true)) < 0) + return r; + if ((r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, NULL, true)) < 0) return r; + } return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true); } diff --git a/src/timer.c b/src/timer.c index 065e9c14..6f1f02dd 100644 --- a/src/timer.c +++ b/src/timer.c @@ -78,9 +78,13 @@ static int timer_add_default_dependencies(Timer *t) { assert(t); - if (t->meta.manager->running_as == MANAGER_SYSTEM) + if (t->meta.manager->running_as == MANAGER_SYSTEM) { + if ((r = unit_add_dependency_by_name(UNIT(t), UNIT_BEFORE, SPECIAL_BASIC_TARGET, NULL, true)) < 0) + return r; + 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); }