Set target state to STOPPED when stop is issued
authorDavin McCall <davmac@davmac.org>
Wed, 4 Dec 2019 12:19:19 +0000 (22:19 +1000)
committerDavin McCall <davmac@davmac.org>
Wed, 4 Dec 2019 12:19:19 +0000 (22:19 +1000)
src/service.cc

index 16cb39455eccccbb0abc1337ecebf095d4ba153e..18987c669ba69cc5e811bc55930f91d3cff1a7e0 100644 (file)
@@ -493,6 +493,8 @@ void service_record::stop(bool bring_down) noexcept
         bring_down = true;
     }
 
+    desired_state = service_state_t::STOPPED;
+
     if (bring_down && service_state != service_state_t::STOPPED
                && service_state != service_state_t::STOPPING) {
        stop_reason = stopped_reason_t::NORMAL;