// Mark this and all dependent services as force-stopped.
void ServiceRecord::forceStop() noexcept
{
- force_stop = true;
- stop();
- for (sr_iter i = dependents.begin(); i != dependents.end(); i++) {
- (*i)->forceStop();
+ if (service_state != ServiceState::STOPPED) {
+ force_stop = true;
+ for (sr_iter i = dependents.begin(); i != dependents.end(); i++) {
+ (*i)->forceStop();
+ }
+ stop();
+
+ // We don't want to force stop soft dependencies, however.
}
- // We don't want to force stop soft dependencies, however.
}
// A dependency of this service failed to start.
void ServiceRecord::pinStart() noexcept
{
- pinned_stopped = false;
start();
pinned_started = true;
}
void ServiceRecord::pinStop() noexcept
{
- pinned_started = false;
stop();
pinned_stopped = true;
}