From: Davin McCall Date: Sun, 3 Jan 2016 16:16:21 +0000 (+0000) Subject: A forced stop at the point of reaching STARTED state should not X-Git-Tag: v0.01~59 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=42883de2774223759aa6bc894a91538b27c78006;p=oweals%2Fdinit.git A forced stop at the point of reaching STARTED state should not actually change the desired state: call start() after stop() if the desired state is not STOPPED. --- diff --git a/service.cc b/service.cc index a3a01eb..06ec5ad 100644 --- a/service.cc +++ b/service.cc @@ -416,7 +416,11 @@ void ServiceRecord::started() noexcept if (force_stop || desired_state == ServiceState::STOPPED) { // We must now stop. + bool do_restart = (desired_state != ServiceState::STOPPED); stop(); + if (do_restart) { + start(); + } return; }