From: Tom Gundersen Date: Tue, 5 Mar 2013 06:56:47 +0000 (+0900) Subject: main: ISOLATE rather than REPLACE default.target X-Git-Tag: v198~58 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=95f1b47d27066c139ca685f65a2e4e91e1c3d6a9;hp=61a9648f022049ac14c5667958752e8dcff857c1 main: ISOLATE rather than REPLACE default.target 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. --- diff --git a/src/core/main.c b/src/core/main.c index 71e0a6cf2..2bbea7ec2 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1720,7 +1720,7 @@ int main(int argc, char *argv[]) { 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);