Revision: 22957 http://trac.macosforge.org/projects/launchd/changeset/22957 Author: zarzycki@apple.com Date: 2006-11-17 15:08:14 -0800 (Fri, 17 Nov 2006) Log Message: ----------- <rdar://problem/4537339> BootRoot: launchd needs to call kextd early if is_bootrooted() Modified Paths: -------------- trunk/launchd/src/launchctl.c trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchctl.c =================================================================== --- trunk/launchd/src/launchctl.c 2006-11-16 22:49:29 UTC (rev 22956) +++ trunk/launchd/src/launchctl.c 2006-11-17 23:08:14 UTC (rev 22957) @@ -64,6 +64,7 @@ #include "libbootstrap_public.h" #include "libvproc_public.h" +#include "libvproc_private.h" #include "libvproc_internal.h" #include "liblaunch_public.h" #include "liblaunch_private.h" @@ -1218,8 +1219,6 @@ do_potential_fsck(); } - do_bootroot_magic(); - if (path_check("/var/account/acct")) { assumes(acct("/var/account/acct") != -1); } @@ -1256,6 +1255,8 @@ preheat_page_cache_hack(); + _vproc_set_global_on_demand(true); + char *load_launchd_items[] = { "load", "-D", "all", "/etc/mach_init.d", NULL }; if (is_safeboot()) load_launchd_items[2] = "system"; @@ -1264,6 +1265,10 @@ const char *bcc_tag_tool[] = { "BootCacheControl", "tag", NULL }; assumes(fwexec(bcc_tag_tool, true) != -1); + do_bootroot_magic(); + + _vproc_set_global_on_demand(false); + const char *SystemStarter_tool[] = { "SystemStarter", NULL }; assumes(fwexec(SystemStarter_tool, false) != -1); Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-11-16 22:49:29 UTC (rev 22956) +++ trunk/launchd/src/launchd_core_logic.c 2006-11-17 23:08:14 UTC (rev 22957) @@ -376,7 +376,7 @@ struct machservice *ms; struct watchpath *wp; - if (!job_assumes(j, j->currently_ignored)) { + if (!j->currently_ignored) { return; } @@ -1642,7 +1642,7 @@ return; } else if (job_useless(j)) { job_remove(j); - } else if (global_on_demand_cnt == 0 && (kickstart || job_keepalive(j))) { + } else if (kickstart || job_keepalive(j)) { job_start(j); } else { job_watch(j); @@ -2688,6 +2688,10 @@ bool good_exit = (WIFEXITED(j->last_exit_status) && WEXITSTATUS(j->last_exit_status) == 0); bool dispatch_others = false; + if (global_on_demand_cnt > 0) { + return false; + } + if (j->runatload && j->start_time == 0) { job_log(j, LOG_DEBUG, "KeepAlive check: job needs to run at least once."); return true;