Fix issue with process services restarting after start timeout.
authorDavin McCall <davmac@davmac.org>
Mon, 15 Jan 2018 21:52:56 +0000 (21:52 +0000)
committerDavin McCall <davmac@davmac.org>
Mon, 15 Jan 2018 21:52:56 +0000 (21:52 +0000)
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
src/tests/test-includes/baseproc-sys.h

index 3692ef74f47bb3f6b5adf6b0c0c0427567d9eaa6..ce94f7bf1688cd3564c3d0e4841c71dbbbd2de44 100644 (file)
@@ -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 {
index bbae1f1366849cb97ba06d0502a48e1b6e974230..5df5b7e982cec10e9d043cf9cf5807632a600e0c 100644 (file)
@@ -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;
 }