From: Davin McCall Date: Fri, 24 Jun 2016 15:30:27 +0000 (+0100) Subject: Remove activated state if a service stops naturally X-Git-Tag: v0.04~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8596e3535c2133e666d38923e4e90c95ff90bf3e;p=oweals%2Fdinit.git Remove activated state if a service stops naturally (if auto-restart is enabled, it will restart instead). --- 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();