summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
diff options
context:
space:
mode:
authorGavin Corkery <gavincorkery@google.com>2020-05-11 14:10:09 +0100
committerGavin Corkery <gavincorkery@google.com>2020-08-21 17:32:34 +0100
commit8c92256df5880072f950adc28891398dce7ffe3a (patch)
tree476ddb80bc7e603e933ed5063535ced280bca300 /init/builtins.cpp
parent3447cdc741214db36f47dd1138b12215a070efa6 (diff)
Store userspace reboot info in /metadata
Store pertinent information about userspace reboot events in the case of failure. This information is any services which failed to stop cleanly, the output of the default fstab and /proc/mounts, and a list of mounts which failed to unmount. This information is only stored as necessary (i.e. mount information will not be stored if everything unmounted, even if some services failed to stop). Added new /metadata/userspacereboot directory to persist this information. Information older than 3 days will be deleted. Test: adb reboot userspace with sigterm/sigkill timeouts set to very low values Test: Manual test of storing all other information Bug: 151820675 Change-Id: I6cfbfae92a7fc6f6c984475cad2c50c559924866
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r--init/builtins.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 0ac66f272..824bd1e78 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -1177,6 +1177,10 @@ static Result<void> do_remount_userdata(const BuiltinArguments& args) {
}
// TODO(b/135984674): check that fstab contains /data.
if (auto rc = fs_mgr_remount_userdata_into_checkpointing(&fstab); rc < 0) {
+ std::string proc_mounts_output;
+ android::base::ReadFileToString("/proc/mounts", &proc_mounts_output, true);
+ android::base::WriteStringToFile(proc_mounts_output,
+ "/metadata/userspacereboot/mount_info.txt");
trigger_shutdown("reboot,mount_userdata_failed");
}
if (auto result = queue_fs_event(initial_mount_fstab_return_code, true); !result.ok()) {