From 86e31a81238fb30d113947e7689a38daf49097f3 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Tue, 25 Apr 2017 17:31:06 -0700 Subject: [PATCH 1/2] init: use full command for exec services' names Before: init: starting service 'exec 4 (/system/bin/vdc)'... init: starting service 'exec 5 (/system/bin/tzdatacheck)'... init: starting service 'exec 6 (/system/bin/bootstat)'... init: starting service 'exec 7 (/system/bin/bootstat)'... After: init: starting service 'exec 4 (/system/bin/vdc --wait cryptfs mountdefaultencrypted)'... init: starting service 'exec 5 (/system/bin/tzdatacheck /system/usr/share/zoneinfo /data/misc/zoneinfo)'... init: starting service 'exec 6 (/system/bin/bootstat -r post_decrypt_time_elapsed)'... init: starting service 'exec 7 (/system/bin/bootstat --record_boot_complete)'... Test: Boot bullhead, observe above logging change Change-Id: I59e2bd9e3d341bbed9537c972e47246d0a12769d --- init/service.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init/service.cpp b/init/service.cpp index 961926a68..ab021fae3 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -926,7 +926,9 @@ Service* ServiceManager::MakeExecOneshotService(const std::vector& std::vector str_args(args.begin() + command_arg, args.end()); exec_count_++; - std::string name = StringPrintf("exec %d (%s)", exec_count_, str_args[0].c_str()); + std::string name = + "exec " + std::to_string(exec_count_) + " (" + android::base::Join(str_args, " ") + ")"; + unsigned flags = SVC_EXEC | SVC_ONESHOT | SVC_TEMPORARY; CapSet no_capabilities; unsigned namespace_flags = 0; From 6f7ef2fb34e4d2b582487ec058748d87adc8b129 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Tue, 25 Apr 2017 17:39:06 -0700 Subject: [PATCH 2/2] init: remove 'computing context for service'... message This line shows up immediately before starting a service for each service without a 'seclabel' option, essentially becoming log spam. We already log if we fail to compute the context as well. Test: Boot bullhead Change-Id: Ibe91fd2dd9f53a8ae2ca95ccea1636ecef2af224 --- init/service.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/init/service.cpp b/init/service.cpp index ab021fae3..2284a2144 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -634,7 +634,6 @@ bool Service::Start() { if (!seclabel_.empty()) { scon = seclabel_; } else { - LOG(INFO) << "computing context for service '" << name_ << "'"; scon = ComputeContextFromExecutable(name_, args_[0]); if (scon == "") { return false;