"exited cleanly with 0 exit status", though it probably does on most real
systems).
// (BGPROCESS only)
doing_recovery = false;
bool need_stop = false;
- if (exit_status != 0) {
+ if ((did_exit && WEXITSTATUS(exit_status) != 0) || was_signalled) {
need_stop = true;
}
else {
if (service_type == ServiceType::PROCESS || service_type == ServiceType::BGPROCESS) {
if (service_state == ServiceState::STARTING) {
// (only applies to BGPROCESS)
- if (exit_status == 0) {
+ if (did_exit && WEXITSTATUS(exit_status) == 0) {
started();
}
else {
}
else { // SCRIPTED
if (service_state == ServiceState::STOPPING) {
- if (exit_status == 0) {
+ if (did_exit && WEXITSTATUS(exit_status) == 0) {
stopped();
}
else {