the services down early.
Also, don't restart a service which has desired_state = STARTED if auto-restart
is disabled.
dependency->dependentStopped();
}
- if (desired_state == ServiceState::STARTED) {
+ if (desired_state == ServiceState::STARTED && service_set->get_auto_restart()) {
// Desired state is "started".
do_start();
}
}
if (need_stop) {
- if (! do_auto_restart()) desired_state = ServiceState::STOPPED;
+ // Failed startup: no auto-restart.
+ desired_state = ServiceState::STOPPED;
do_stop();
}
restart_enabled = false;
shutdown_type = type;
for (std::list<ServiceRecord *>::iterator i = records.begin(); i != records.end(); ++i) {
- (*i)->stop();
+ (*i)->stop(false);
(*i)->unpin();
}
}