Clear the stop timer if scripted start is interrupted.
authorDavin McCall <davmac@davmac.org>
Sun, 26 May 2019 04:09:10 +0000 (14:09 +1000)
committerDavin McCall <davmac@davmac.org>
Sun, 26 May 2019 04:48:37 +0000 (14:48 +1000)
src/proc-service.cc

index 8db6877ca643341a2eb1faa30f31064127455b54..d12a42cae763094fc23592f74f90105edfdf7d1d 100644 (file)
@@ -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 {