Merge "init: log failures if a service cannot start during class_start"
am: 533fbd62ab
Change-Id: I7a05ae9f806a23d04d649fb230e2875633b2caee
This commit is contained in:
commit
5c00898944
1 changed files with 8 additions and 1 deletions
|
|
@ -99,7 +99,14 @@ static void ForEachServiceInClass(const std::string& classname, F function) {
|
||||||
static Result<Success> do_class_start(const BuiltinArguments& args) {
|
static Result<Success> do_class_start(const BuiltinArguments& args) {
|
||||||
// Starting a class does not start services which are explicitly disabled.
|
// Starting a class does not start services which are explicitly disabled.
|
||||||
// They must be started individually.
|
// 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();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue