From: Davin McCall Date: Sat, 2 Jan 2016 18:41:05 +0000 (+0000) Subject: If a "scripted" service has no stop command, allow it to stop immediately. X-Git-Tag: v0.01~64 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f01505450ffa88ceb3119785ea38b5936ae996bd;p=oweals%2Fdinit.git If a "scripted" service has no stop command, allow it to stop immediately. This allows no stop command to be specified if none is needed. (This probably already worked, but only because Dinit would try to exec "" (the empty string) when the service stopped, which would fail, and the service would get marked as stopped anyway). --- diff --git a/service.cc b/service.cc index a2a5d8e..c60c228 100644 --- a/service.cc +++ b/service.cc @@ -621,7 +621,10 @@ void ServiceRecord::allDepsStopped() } else if (service_type == ServiceType::SCRIPTED) { // Scripted service. - if (! start_ps_process(stop_arg_parts, false)) { + if (stop_command.length() == 0) { + stopped(); + } + else if (! start_ps_process(stop_arg_parts, false)) { // Couldn't execute stop script, but there's not much we can do: stopped(); }