diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-24 03:09:39 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-24 03:09:39 +0000 |
commit | cf7de05fb60c11638fd32c8040b80e801507ea5b (patch) | |
tree | ae2586789cef5c7ed4fe0039bb1eacf6c3370c24 /init/service.cpp | |
parent | 777ba7d6926b48aa52383bb49e98e0a229f41173 (diff) | |
parent | f3fea3777299843b34afd5f5453e80183fa3ad99 (diff) |
Snap for 7579381 from f3fea3777299843b34afd5f5453e80183fa3ad99 to sc-release
Change-Id: I26175ebce303747d37b8a1c057c57d881623d659
Diffstat (limited to 'init/service.cpp')
-rw-r--r-- | init/service.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/init/service.cpp b/init/service.cpp index 5af81bf87..c3069f5b2 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -194,8 +194,6 @@ void Service::KillProcessGroup(int signal, bool report_oneshot) { << ") process group..."; int max_processes = 0; int r; - - flags_ |= SVC_STOPPING; if (signal == SIGTERM) { r = killProcessGroupOnce(proc_attr_.uid, pid_, signal, &max_processes); } else { @@ -279,8 +277,7 @@ void Service::Reap(const siginfo_t& siginfo) { f(siginfo); } - if ((siginfo.si_code != CLD_EXITED || siginfo.si_status != 0) && on_failure_reboot_target_ && - !(flags_ & SVC_STOPPING)) { + if ((siginfo.si_code != CLD_EXITED || siginfo.si_status != 0) && on_failure_reboot_target_) { LOG(ERROR) << "Service with 'reboot_on_failure' option failed, shutting down system."; trigger_shutdown(*on_failure_reboot_target_); } @@ -290,7 +287,7 @@ void Service::Reap(const siginfo_t& siginfo) { if (flags_ & SVC_TEMPORARY) return; pid_ = 0; - flags_ &= ~(SVC_RUNNING | SVC_STOPPING); + flags_ &= (~SVC_RUNNING); start_order_ = 0; // Oneshot processes go into the disabled state on exit, @@ -414,8 +411,7 @@ Result<void> Service::Start() { bool disabled = (flags_ & (SVC_DISABLED | SVC_RESET)); // Starting a service removes it from the disabled or reset state and // immediately takes it out of the restarting state if it was in there. - flags_ &= (~(SVC_DISABLED | SVC_RESTARTING | SVC_RESET | SVC_RESTART | SVC_DISABLED_START | - SVC_STOPPING)); + flags_ &= (~(SVC_DISABLED|SVC_RESTARTING|SVC_RESET|SVC_RESTART|SVC_DISABLED_START)); // Running processes require no additional work --- if they're in the // process of exiting, we've ensured that they will immediately restart |