summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2017-10-03 13:15:03 -0700
committerTom Cherry <tomcherry@google.com>2017-10-03 13:16:00 -0700
commitef68972852af92abb65569c8ff5778a7325f3b4c (patch)
tree1bebe6d16b72379e3303d42890c53a03183f991e /init/builtins.cpp
parent23313c2f8549d6b2caa430fabcd5ecd9e8013d5c (diff)
init: log failures if a service cannot start during class_start
Test: boot system with this logging and see appropriate failures Change-Id: I312dca89f6215afe05b10b2539258a212a0c1ae2
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r--init/builtins.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 60c0007c0e..027b392fd0 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -99,7 +99,14 @@ static void ForEachServiceInClass(const std::string& classname, F function) {
static Result<Success> do_class_start(const BuiltinArguments& args) {
// Starting a class does not start services which are explicitly disabled.
// They must be started individually.
- ForEachServiceInClass(args[1], &Service::StartIfNotDisabled);
+ for (const auto& service : ServiceList::GetInstance()) {
+ if (service->classnames().count(args[1])) {
+ if (auto result = service->StartIfNotDisabled(); !result) {
+ LOG(ERROR) << "Could not start service '" << service->name()
+ << "' as part of class '" << args[1] << "': " << result.error();
+ }
+ }
+ }
return Success();
}