process service: allow start timeout, but don't arm timer.
authorDavin McCall <davmac@davmac.org>
Thu, 25 Jan 2018 22:17:02 +0000 (22:17 +0000)
committerDavin McCall <davmac@davmac.org>
Thu, 25 Jan 2018 22:17:02 +0000 (22:17 +0000)
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
src/includes/proc-service.h

index 481e9f61bc20fbcdeb22bf418031fe9926f68067..e53028cf09e8a8b709545e0b32d7c87152d79cee 100644 (file)
@@ -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;
             }
index 4953ca18f9c4fe5372640b89860139d3d547d524..606c5b15e28d809cd8373c7b544403018590b7ff 100644 (file)
@@ -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