From 7a1f2650b293041885ff609f4f9238017c6fc4b6 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sun, 26 May 2019 14:09:10 +1000 Subject: [PATCH] Clear the stop timer if scripted start is interrupted. --- src/proc-service.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/proc-service.cc b/src/proc-service.cc index 8db6877..d12a42c 100644 --- a/src/proc-service.cc +++ b/src/proc-service.cc @@ -368,11 +368,15 @@ void scripted_service::handle_exit_status(bp_sys::exit_status exit_status) noexc // We might be running the stop script, or we might be running the start script and have issued // a cancel order via SIGINT: if (interrupting_start) { + if (stop_timer_armed) { + restart_timer.stop_timer(event_loop); + stop_timer_armed = false; + } // We issued a start interrupt, so we expected this failure: if (did_exit && exit_status.get_exit_status() != 0) { log(loglevel_t::INFO, "Service ", get_name(), " start cancelled; exit code ", exit_status.get_exit_status()); - // Assume that a command terminating normally requires no cleanup: + // Assume that a command terminating normally (with failure status) requires no cleanup: stopped(); } else { -- 2.25.1