init: move `MarkServicesUpdate` later
MarkServicesUpdate() starts delayed services which are mostly for
APEXes. (e.g. start a service from APEX). But before
"DefaultNamespaceReady", services are started in "bootstrap" mount
namespace, which makes services from non-bootstrap APEXes fail to start.
This is a quick fix for the problem before coming up with better
solution in the future.
Bug: 293535323
Test: add 'start adbd' before 'perform_apex_config' in init.rc
adbd starts successfully.
Change-Id: I846689f7c38cdca83c1f7faec0106b8174527e09
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 2176233..fa5e36d 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -1297,7 +1297,6 @@
return create_dirs.error();
}
auto parse_configs = ParseApexConfigs(/*apex_name=*/"");
- ServiceList::GetInstance().MarkServicesUpdate();
if (!parse_configs.ok()) {
return parse_configs.error();
}
@@ -1307,6 +1306,8 @@
return update_linker_config.error();
}
+ // Now start delayed services
+ ServiceList::GetInstance().MarkServicesUpdate();
return {};
}