summaryrefslogtreecommitdiff
path: root/init/reboot.cpp
diff options
context:
space:
mode:
authorJustin DeMartino <jjdemartino@google.com>2020-10-14 19:39:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-10-14 19:39:53 +0000
commit0d11af03e43f110b0bb160f7e20436d0043e3038 (patch)
tree48f8bcca856276ec73a86dd3fb26143d3ca64578 /init/reboot.cpp
parent075666ebd0dee8d0c4a2efa54f7c324a3f67ee2a (diff)
parenta6c01e4e98d2b343dcecfc99611e2e6250c730db (diff)
Merge changes from topic "SP1A.200921.001" into s-keystone-qcom-dev
* changes: fs_mgr: adb-remount-test.sh: filter out more administrivia mounts. Merge SP1A.200921.001 Change-Id: I90b97c4e9fb10b1f45e74def404823eed5b1aaa8
Diffstat (limited to 'init/reboot.cpp')
-rw-r--r--init/reboot.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/init/reboot.cpp b/init/reboot.cpp
index c5446717a..2065fcf16 100644
--- a/init/reboot.cpp
+++ b/init/reboot.cpp
@@ -815,11 +815,19 @@ static Result<void> DoUserspaceReboot() {
auto sigkill_timeout = GetMillisProperty("init.userspace_reboot.sigkill.timeoutmillis", 10s);
LOG(INFO) << "Timeout to terminate services: " << sigterm_timeout.count() << "ms "
<< "Timeout to kill services: " << sigkill_timeout.count() << "ms";
+ std::string services_file_name = "/metadata/userspacereboot/services.txt";
+ const int flags = O_RDWR | O_CREAT | O_SYNC | O_APPEND | O_CLOEXEC;
StopServicesAndLogViolations(stop_first, sigterm_timeout, true /* SIGTERM */);
if (int r = StopServicesAndLogViolations(stop_first, sigkill_timeout, false /* SIGKILL */);
r > 0) {
+ auto fd = unique_fd(TEMP_FAILURE_RETRY(open(services_file_name.c_str(), flags, 0666)));
+ android::base::WriteStringToFd("Post-data services still running: \n", fd);
+ for (const auto& s : stop_first) {
+ if (s->IsRunning()) {
+ android::base::WriteStringToFd(s->name() + "\n", fd);
+ }
+ }
sub_reason = "sigkill";
- // TODO(b/135984674): store information about offending services for debugging.
return Error() << r << " post-data services are still running";
}
if (auto result = KillZramBackingDevice(); !result.ok()) {
@@ -833,8 +841,14 @@ static Result<void> DoUserspaceReboot() {
if (int r = StopServicesAndLogViolations(GetDebuggingServices(true /* only_post_data */),
sigkill_timeout, false /* SIGKILL */);
r > 0) {
+ auto fd = unique_fd(TEMP_FAILURE_RETRY(open(services_file_name.c_str(), flags, 0666)));
+ android::base::WriteStringToFd("Debugging services still running: \n", fd);
+ for (const auto& s : GetDebuggingServices(true)) {
+ if (s->IsRunning()) {
+ android::base::WriteStringToFd(s->name() + "\n", fd);
+ }
+ }
sub_reason = "sigkill_debug";
- // TODO(b/135984674): store information about offending services for debugging.
return Error() << r << " debugging services are still running";
}
{