From 8596e3535c2133e666d38923e4e90c95ff90bf3e Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Fri, 24 Jun 2016 16:30:27 +0100 Subject: [PATCH] Remove activated state if a service stops naturally (if auto-restart is enabled, it will restart instead). --- src/service.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/service.cc b/src/service.cc index 566bd05..5425a21 100644 --- a/src/service.cc +++ b/src/service.cc @@ -91,11 +91,18 @@ void ServiceRecord::stopped() noexcept service_set->addToStartQueue(this); } else { + desired_state = ServiceState::STOPPED; + if (socket_fd != -1) { close(socket_fd); socket_fd = -1; } + if (start_explicit) { + start_explicit = false; + required_by--; + } + if (required_by == 0) { // Service is now completely inactive. release_dependencies(); -- 2.25.1