From b070a69ac5a2eb7c74933aac8fbeb2c343c0b25f Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Mon, 15 Jan 2018 21:52:56 +0000 Subject: [PATCH] Fix issue with process services restarting after start timeout. A process which fails to start with a timeout should count as a start failure. Therefore, remove explicit activation in this case (and thereby prevent the service from restarting). --- src/baseproc-service.cc | 4 ++++ src/tests/test-includes/baseproc-sys.h | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/baseproc-service.cc b/src/baseproc-service.cc index 3692ef7..ce94f7b 100644 --- a/src/baseproc-service.cc +++ b/src/baseproc-service.cc @@ -331,6 +331,10 @@ void base_process_service::timer_expired() noexcept else if (pid != -1) { // Starting, start timed out. stop_dependents(); + if (start_explicit) { + start_explicit = false; + release(); + } interrupt_start(); } else { diff --git a/src/tests/test-includes/baseproc-sys.h b/src/tests/test-includes/baseproc-sys.h index bbae1f1..5df5b7e 100644 --- a/src/tests/test-includes/baseproc-sys.h +++ b/src/tests/test-includes/baseproc-sys.h @@ -16,9 +16,7 @@ inline int fcntl(int fd, int cmd, ...) inline int kill(pid_t pid, int sig) { - // No proper mock implemented yet: - std::cout << "(kill; aborting)" << std::endl; - abort(); + // No proper mock implemented yet, just return success for now: return 0; } -- 2.25.1