chiark / gitweb /
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 462f317..b45cbcf 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 1d6f98c..f62157e 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 6d2df95..9662066 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 065e9c1..6f1f02d 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);
 }