Loading init/README.md +2 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ runs the service. will reboot into _fatal reboot target_. The default value of _fatal crash window mins_ is 4, and default value of _fatal reboot target_ is 'bootloader'. For tests, the fatal reboot can be skipped by setting property `init.svc_debug.no_fatal.<service-name>` to `true` for specified critical service. `disabled` > This service will not automatically start with its class. Loading init/service.cpp +8 −5 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ #endif using android::base::boot_clock; using android::base::GetBoolProperty; using android::base::GetProperty; using android::base::Join; using android::base::make_scope_guard; Loading Loading @@ -318,17 +319,19 @@ void Service::Reap(const siginfo_t& siginfo) { // reboot into bootloader or set crashing property boot_clock::time_point now = boot_clock::now(); if (((flags_ & SVC_CRITICAL) || is_process_updatable) && !(flags_ & SVC_RESTART)) { bool boot_completed = android::base::GetBoolProperty("sys.boot_completed", false); bool boot_completed = GetBoolProperty("sys.boot_completed", false); if (now < time_crashed_ + fatal_crash_window_ || !boot_completed) { if (++crash_count_ > 4) { auto exit_reason = boot_completed ? "in " + std::to_string(fatal_crash_window_.count()) + " minutes" : "before boot completed"; if (flags_ & SVC_CRITICAL) { if (!GetBoolProperty("init.svc_debug.no_fatal." + name_, false)) { // Aborts into `fatal_reboot_target_'. SetFatalRebootTarget(fatal_reboot_target_); LOG(FATAL) << "critical process '" << name_ << "' exited 4 times " << exit_reason; } } else { LOG(ERROR) << "process with updatable components '" << name_ << "' exited 4 times " << exit_reason; Loading Loading
init/README.md +2 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ runs the service. will reboot into _fatal reboot target_. The default value of _fatal crash window mins_ is 4, and default value of _fatal reboot target_ is 'bootloader'. For tests, the fatal reboot can be skipped by setting property `init.svc_debug.no_fatal.<service-name>` to `true` for specified critical service. `disabled` > This service will not automatically start with its class. Loading
init/service.cpp +8 −5 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ #endif using android::base::boot_clock; using android::base::GetBoolProperty; using android::base::GetProperty; using android::base::Join; using android::base::make_scope_guard; Loading Loading @@ -318,17 +319,19 @@ void Service::Reap(const siginfo_t& siginfo) { // reboot into bootloader or set crashing property boot_clock::time_point now = boot_clock::now(); if (((flags_ & SVC_CRITICAL) || is_process_updatable) && !(flags_ & SVC_RESTART)) { bool boot_completed = android::base::GetBoolProperty("sys.boot_completed", false); bool boot_completed = GetBoolProperty("sys.boot_completed", false); if (now < time_crashed_ + fatal_crash_window_ || !boot_completed) { if (++crash_count_ > 4) { auto exit_reason = boot_completed ? "in " + std::to_string(fatal_crash_window_.count()) + " minutes" : "before boot completed"; if (flags_ & SVC_CRITICAL) { if (!GetBoolProperty("init.svc_debug.no_fatal." + name_, false)) { // Aborts into `fatal_reboot_target_'. SetFatalRebootTarget(fatal_reboot_target_); LOG(FATAL) << "critical process '" << name_ << "' exited 4 times " << exit_reason; } } else { LOG(ERROR) << "process with updatable components '" << name_ << "' exited 4 times " << exit_reason; Loading