Default is 60 seconds.
restart over the interval specified by restart-limit-interval (default of
10 seconds). Specify a value of 0 to disable the restart limit.
-stop-timeout = XXX.YYYY
+stop-timeout = XXX.YYYY (or XXX,YYYY)
Specifies the time in seconds allowed for the service to stop. If the
service takes longer than this, its process group is sent a SIGKILL signal
which should cause it to terminate immediately. The timeout period begins
only when all dependent services have already stopped. The default stop
timeout is 10 seconds.
+start-timeout = XXX.YYYY (or XXX,YYYY)
+ Specifies the time in seconds allowed for the service to start. IF the
+ service startup takes longer than this, its process group is sent a
+ SIGINT signal and transitions to the "stopping" state. if it fails to stop
+ within the period specified by the stop-timeout setting, it is sent a
+ SIGKILL signal.
+
pid-file = (path to file)
For "bgprocess" type services only; specifies the path of the file where
daemon will write its process ID before detaching.
* shutdown command presently hangs if terminal output blocked (scroll lock
via ^S). Should use a buffer as dinit does, and pipe output from subcommands
- via the buffer too.
+ via the buffer too - if the buffer becomes full, discard subcommand output
+ and continue to consume it.
* Document utilities (particularly dinitctl) in the README
+* scripted process interrupted start might still complete successfully. State will
+ be STOPPING (due to interruptiong), but stop script should still be run in this
+ case.
For version 1.0:
----------------
* Load services from several different directories, with an order of precedence,
to allow for packaged service descriptions and user-modified service
descriptions.
+* on shutdown, after repeated intervals with no activity, display information
+ about services we are waiting on.
For later:
----------
over the interval specified by \fBrestart-limit-interval\fR. Specify a value
of 0 to disable the restart limit.
.TP
+\fBstart-timeout\fR = \fIXXX.YYY\fR
+Specifies the time in seconds allowed for the service to start. If the
+service takes longer than this, its process group is sent a SIGINT signal
+and enters the "stopping" state (this may be subject to a stop timeout, as
+specified via \fBstop-timeout\fR, after which the process group will be
+terminated via SIGKILL). The timeout period begins only when all dependencies
+have been stopped. The default timeout is 60 seconds. Specify a value of 0 to
+allow unlimited start time.
+.TP
\fBstop-timeout\fR = \fIXXX.YYY\fR
Specifies the time in seconds allowed for the service to stop. If the
service takes longer than this, its process group is sent a SIGKILL signal
int max_restarts = 3;
timespec restart_delay = { .tv_sec = 0, .tv_nsec = 200000000 };
timespec stop_timeout = { .tv_sec = 10, .tv_nsec = 0 };
+ timespec start_timeout = { .tv_sec = 60, .tv_nsec = 0 };
string line;
ifstream service_file;
string stoptimeout_str = read_setting_value(i, end, nullptr);
parse_timespec(stoptimeout_str, name, "stop-timeout", stop_timeout);
}
+ else if (setting == "start-timeout") {
+ string starttimeout_str = read_setting_value(i, end, nullptr);
+ parse_timespec(starttimeout_str, name, "start-timeout", start_timeout);
+ }
else {
throw service_description_exc(name, "Unknown setting: " + setting);
}
rvalps->set_restart_interval(restart_interval, max_restarts);
rvalps->set_restart_delay(restart_delay);
rvalps->set_stop_timeout(stop_timeout);
+ rvalps->set_start_timeout(start_timeout);
rvalps->set_start_interruptible(start_is_interruptible);
rval = rvalps;
}
rvalps->set_restart_interval(restart_interval, max_restarts);
rvalps->set_restart_delay(restart_delay);
rvalps->set_stop_timeout(stop_timeout);
+ rvalps->set_start_timeout(start_timeout);
rvalps->set_start_interruptible(start_is_interruptible);
rval = rvalps;
}
command_offsets, depends);
rvalps->set_stop_command(stop_command, stop_command_offsets);
rvalps->set_stop_timeout(stop_timeout);
+ rvalps->set_start_timeout(start_timeout);
rvalps->set_start_interruptible(start_is_interruptible);
rval = rvalps;
}
stop_timeout = timeout;
}
+ void set_start_timeout(timespec timeout) noexcept
+ {
+ start_timeout = timeout;
+ }
+
void set_start_interruptible(bool value) noexcept
{
start_is_interruptible = value;