From 61169c76dda5f523b1181f388bcaefd67c0aa612 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 17 May 2022 22:53:11 +0000 Subject: [PATCH] init: log services requested restart We have a case where a service is requested to be started and does not appear to be running, but we see no indication that it is actually starting. This log should be enough information to see if init is in a bad state. Bug: 232297944 Test: doesn't add too much spam ~/android/aosp/system/core/init :) adb logcat -d | grep "requested start" | wc -l 42 Change-Id: Ic07f250c98b200b9e5b4432200c3668c6ca0ff35 --- init/service.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init/service.cpp b/init/service.cpp index 95a532850..01dd68561 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -545,6 +545,10 @@ Result Service::Start() { if ((flags_ & SVC_ONESHOT) && disabled) { flags_ |= SVC_RESTART; } + + LOG(INFO) << "service '" << name_ + << "' requested start, but it is already running (flags: " << flags_ << ")"; + // It is not an error to try to start a service that is already running. reboot_on_failure.Disable(); return {};