From 5ffd88f26f0bb8fe7bfa0058f70c7e40bf7e8f9f Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Fri, 28 Jul 2023 17:28:27 +0900 Subject: [PATCH] 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 --- init/builtins.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/builtins.cpp b/init/builtins.cpp index 2176233aa..fa5e36d52 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -1297,7 +1297,6 @@ static Result do_perform_apex_config(const BuiltinArguments& args) { 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 @@ static Result do_perform_apex_config(const BuiltinArguments& args) { return update_linker_config.error(); } + // Now start delayed services + ServiceList::GetInstance().MarkServicesUpdate(); return {}; }