From 42883de2774223759aa6bc894a91538b27c78006 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sun, 3 Jan 2016 16:16:21 +0000 Subject: [PATCH] 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. --- service.cc | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.25.1