stop: if not required, treat stop as full manual stop.
authorDavin McCall <davmac@davmac.org>
Sat, 27 Jul 2019 12:22:02 +0000 (22:22 +1000)
committerDavin McCall <davmac@davmac.org>
Sat, 27 Jul 2019 12:22:02 +0000 (22:22 +1000)
This is needed to properly handle shutdown when a service is alive but
not marked active.

src/service.cc

index fb0573e469e285a9ed5d1ecab9bb5efc2820cad8..b516c4421b4c3ce57a20ceca8d607c9422a4a202 100644 (file)
@@ -457,6 +457,9 @@ void service_record::stop(bool bring_down) noexcept
         release();
     }
 
+    // If our required_by count is 0, we should treat this as a full manual stop regardless
+    if (required_by == 0) bring_down = true;
+
     // If it's a manual bring-down, we'll also break holds from waits-for dependencies, to avoid
     // bouncing back up again -- but only if all holds are from waits-for dependencies.
     if (bring_down) {