From 5cc8ab84102b16919d57ff0ef92c03a73d1002e5 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sat, 27 Jul 2019 22:22:02 +1000 Subject: [PATCH] stop: if not required, treat stop as full manual stop. This is needed to properly handle shutdown when a service is alive but not marked active. --- src/service.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/service.cc b/src/service.cc index fb0573e..b516c44 100644 --- a/src/service.cc +++ b/src/service.cc @@ -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) { -- 2.25.1