chiark / gitweb /
main: ISOLATE rather than REPLACE default.target
authorTom Gundersen <teg@jklm.no>
Tue, 5 Mar 2013 06:56:47 +0000 (15:56 +0900)
committerLennart Poettering <lennart@poettering.net>
Wed, 6 Mar 2013 15:24:49 +0000 (16:24 +0100)
This allows switch-root to work correctly if a unit is active both before and
after the switch-root, but its dependencies change. Before the patch, any
dependencies added to active units by switch-root will not be pulled, in
particular filesystems configured in /etc/fstab would not be activated if
local-fs.target was active in the initrd.

It is not clear to me if there is a bug in the REPLACE handling, or if it is
working as expected and that we really want to use ISOLATE instead as this patch
does.

src/core/main.c

index 71e0a6cf2f7125946b834f18b575334a165cf060..2bbea7ec2f153d8bbb9e6cedde01929e1927e7f9 100644 (file)
@@ -1720,7 +1720,7 @@ int main(int argc, char *argv[]) {
                         manager_dump_units(m, stdout, "\t");
                 }
 
                         manager_dump_units(m, stdout, "\t");
                 }
 
-                r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &error, &default_unit_job);
+                r = manager_add_job(m, JOB_START, target, JOB_ISOLATE, false, &error, &default_unit_job);
                 if (r < 0) {
                         log_error("Failed to start default target: %s", bus_error(&error, r));
                         dbus_error_free(&error);
                 if (r < 0) {
                         log_error("Failed to start default target: %s", bus_error(&error, r));
                         dbus_error_free(&error);