From: Davin McCall Date: Thu, 25 Jan 2018 22:17:02 +0000 (+0000) Subject: process service: allow start timeout, but don't arm timer. X-Git-Tag: v0.08~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d2eab6ec42fd1807034cfee6fddac9649de62a71;p=oweals%2Fdinit.git 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). --- 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