From: Davin McCall Date: Fri, 9 Jun 2017 16:19:11 +0000 (+0100) Subject: service: only force stop dependents if necessary. X-Git-Tag: v0.06~80 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e23e73f1d91db1b6261ba71813207e7d01cb2981;p=oweals%2Fdinit.git service: only force stop dependents if necessary. Only force-stop dependent services if this service is force-stopped. --- diff --git a/src/service.cc b/src/service.cc index 1ce35c8..1b19770 100644 --- a/src/service.cc +++ b/src/service.cc @@ -1083,7 +1083,12 @@ bool ServiceRecord::stopDependents() noexcept all_deps_stopped = false; } - (*i)->forceStop(); + if (force_stop) { + // If this service is to be forcefully stopped, dependents must also be. + (*i)->forceStop(); + } + + (*i)->do_stop(); } return all_deps_stopped;