summaryrefslogtreecommitdiffstats
path: root/init/service.cpp
diff options
context:
space:
mode:
authorPaul Crowley <paulcrowley@google.com>2018-04-13 17:38:57 +0000
committerPaul Crowley <paulcrowley@google.com>2018-04-17 09:03:57 -0700
commitc73b21558be59369aceb9a62174343ff2837b9f5 (patch)
treed758a6fb43c18e4ee025afe0678e185eca7464f9 /init/service.cpp
parent07de83831f9a2bf67e1c4a4df72baed42b26c7e9 (diff)
downloadsystem_core-c73b21558be59369aceb9a62174343ff2837b9f5.tar.gz
system_core-c73b21558be59369aceb9a62174343ff2837b9f5.tar.bz2
system_core-c73b21558be59369aceb9a62174343ff2837b9f5.zip
Re-land "If enablefilecrypto or init_user0 fails, reboot into recovery."
An earlier such change was reverted in commit e242a97db547dc73efea1b5287536be66637dc33. Bug: 70487538 Test: ensure that angler can boot Merged-In: Id5f57fce1c9b817a2650e0c848143d8a0d286bf0 Change-Id: Id5f57fce1c9b817a2650e0c848143d8a0d286bf0
Diffstat (limited to 'init/service.cpp')
-rw-r--r--init/service.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/init/service.cpp b/init/service.cpp
index 694e5e713..f9986c5f5 100644
--- a/init/service.cpp
+++ b/init/service.cpp
@@ -303,7 +303,7 @@ void Service::SetProcessAttributes() {
}
}
-void Service::Reap() {
+void Service::Reap(const siginfo_t& siginfo) {
if (!(flags_ & SVC_ONESHOT) || (flags_ & SVC_RESTART)) {
KillProcessGroup(SIGKILL);
}
@@ -312,6 +312,10 @@ void Service::Reap() {
std::for_each(descriptors_.begin(), descriptors_.end(),
std::bind(&DescriptorInfo::Clean, std::placeholders::_1));
+ for (const auto& f : reap_callbacks_) {
+ f(siginfo);
+ }
+
if (flags_ & SVC_EXEC) UnSetExec();
if (flags_ & SVC_TEMPORARY) return;