]> err.no Git - systemd/commitdiff
units: order units by default before appropriate targets in case they are pulled...
authorLennart Poettering <lennart@poettering.net>
Fri, 29 Oct 2010 04:04:03 +0000 (06:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 29 Oct 2010 14:28:29 +0000 (16:28 +0200)
src/automount.c
src/path.c
src/socket.c
src/timer.c

index 462f3170bac7acbecbb02c94acc7a695f6f76bbb..b45cbcf53380171efeacbaa571ae5dc2a560ec52 100644 (file)
@@ -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;
         }
index 1d6f98cfbdb3e7dbaa5a254e65ef672278aae5d4..f62157e80184260a4a04f1a73177a7dea8a9cc2f 100644 (file)
@@ -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);
 }
index 6d2df9581324da604422aba3da77c3a3004d62ae..9662066c138429cfd0d2f9e26e8dd132801c5385 100644 (file)
@@ -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);
 }
index 065e9c14dbf7905f3df603f8922351305425f1b3..6f1f02ddbc65a62312c19f34771db72d9a985ee0 100644 (file)
@@ -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);
 }