From f01505450ffa88ceb3119785ea38b5936ae996bd Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sat, 2 Jan 2016 18:41:05 +0000 Subject: [PATCH] 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). --- service.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); } -- 2.25.1