From d2eab6ec42fd1807034cfee6fddac9649de62a71 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 25 Jan 2018 22:17:02 +0000 Subject: [PATCH] process service: allow start timeout, but don't arm timer. Timeout for process services is currently meaningless, although when startup notification is implemented it will take on meaning. This is a slightly cleaner fix than just forcing the timeout to 0 in the constructor (since it can then still be later set to a value that won't work). --- src/baseproc-service.cc | 3 ++- src/includes/proc-service.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/baseproc-service.cc b/src/baseproc-service.cc index 481e9f6..e53028c 100644 --- a/src/baseproc-service.cc +++ b/src/baseproc-service.cc @@ -43,7 +43,8 @@ bool base_process_service::bring_up() noexcept event_loop.get_time(restart_interval_time, clock_type::MONOTONIC); restart_interval_count = 0; if (start_ps_process(exec_arg_parts, onstart_flags.starts_on_console)) { - if (start_timeout != time_val(0,0)) { + // Note: we don't set a start timeout for PROCESS services. + if (start_timeout != time_val(0,0) && get_type() != service_type_t::PROCESS) { restart_timer.arm_timer_rel(event_loop, start_timeout); stop_timer_armed = true; } diff --git a/src/includes/proc-service.h b/src/includes/proc-service.h index 4953ca1..606c5b1 100644 --- a/src/includes/proc-service.h +++ b/src/includes/proc-service.h @@ -204,7 +204,6 @@ class process_service : public base_process_service : base_process_service(sset, name, service_type_t::PROCESS, std::move(command), command_offsets, depends_p) { - start_timeout = time_val(0,0); } ~process_service() noexcept -- 2.25.1