@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u RestartSteps = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
- readonly t RestartUSecMax = ...;
+ readonly t RestartMaxDelayUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly t RestartUSecNext = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
<!--property RestartSteps is not documented!-->
- <!--property RestartUSecMax is not documented!-->
+ <!--property RestartMaxDelayUSec is not documented!-->
<!--property RestartUSecNext is not documented!-->
<variablelist class="dbus-property" generated="True" extra-ref="RestartSteps"/>
- <variablelist class="dbus-property" generated="True" extra-ref="RestartUSecMax"/>
+ <variablelist class="dbus-property" generated="True" extra-ref="RestartMaxDelayUSec"/>
<variablelist class="dbus-property" generated="True" extra-ref="RestartUSecNext"/>
<varlistentry>
<term><varname>RestartSteps=</varname></term>
<listitem><para>Configures the number of steps to take to increase the interval
- of auto-restarts from <varname>RestartSec=</varname> to <varname>RestartSecMax=</varname>.
+ of auto-restarts from <varname>RestartSec=</varname> to <varname>RestartMaxDelaySec=</varname>.
Takes a positive integer or 0 to disable it. Defaults to 0.</para>
- <para>This setting is effective only if <varname>RestartSecMax=</varname> is also set.</para></listitem>
+ <para>This setting is effective only if <varname>RestartMaxDelaySec=</varname> is also set.</para></listitem>
</varlistentry>
<varlistentry>
- <term><varname>RestartSecMax=</varname></term>
+ <term><varname>RestartMaxDelaySec=</varname></term>
<listitem><para>Configures the longest time to sleep before restarting a service
as the interval goes up with <varname>RestartSteps=</varname>. Takes a value
in the same format as <varname>RestartSec=</varname>, or <literal>infinity</literal>
SD_BUS_PROPERTY("NotifyAccess", "s", property_get_notify_access, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("RestartUSec", "t", bus_property_get_usec, offsetof(Service, restart_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("RestartSteps", "u", bus_property_get_unsigned, offsetof(Service, restart_steps), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_PROPERTY("RestartUSecMax", "t", bus_property_get_usec, offsetof(Service, restart_usec_max), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("RestartMaxDelayUSec", "t", bus_property_get_usec, offsetof(Service, restart_max_delay_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("RestartUSecNext", "t", property_get_restart_usec_next, 0, 0),
SD_BUS_PROPERTY("TimeoutStartUSec", "t", bus_property_get_usec, offsetof(Service, timeout_start_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("TimeoutStopUSec", "t", bus_property_get_usec, offsetof(Service, timeout_stop_usec), SD_BUS_VTABLE_PROPERTY_CONST),
if (streq(name, "RestartSteps"))
return bus_set_transient_unsigned(u, name, &s->restart_steps, message, flags, error);
- if (streq(name, "RestartUSecMax"))
- return bus_set_transient_usec(u, name, &s->restart_usec_max, message, flags, error);
+ if (streq(name, "RestartMaxDelayUSec"))
+ return bus_set_transient_usec(u, name, &s->restart_max_delay_usec, message, flags, error);
if (streq(name, "TimeoutStartUSec")) {
r = bus_set_transient_usec(u, name, &s->timeout_start_usec, message, flags, error);
Service.ExecStopPost, config_parse_exec, SERVICE_EXEC_STOP_POST, offsetof(Service, exec_command)
Service.RestartSec, config_parse_sec, 0, offsetof(Service, restart_usec)
Service.RestartSteps, config_parse_unsigned, 0, offsetof(Service, restart_steps)
-Service.RestartSecMax, config_parse_sec, 0, offsetof(Service, restart_usec_max)
+Service.RestartMaxDelaySec, config_parse_sec, 0, offsetof(Service, restart_max_delay_usec)
Service.TimeoutSec, config_parse_service_timeout, 0, 0
Service.TimeoutStartSec, config_parse_service_timeout, 0, 0
Service.TimeoutStopSec, config_parse_sec_fix_0, 0, offsetof(Service, timeout_stop_usec)
s->timeout_abort_usec = u->manager->default_timeout_abort_usec;
s->timeout_abort_set = u->manager->default_timeout_abort_set;
s->restart_usec = u->manager->default_restart_usec;
- s->restart_usec_max = USEC_INFINITY;
+ s->restart_max_delay_usec = USEC_INFINITY;
s->runtime_max_usec = USEC_INFINITY;
s->type = _SERVICE_TYPE_INVALID;
s->socket_fd = -EBADF;
if (n_restarts_next <= 1 ||
s->restart_steps == 0 ||
- s->restart_usec_max == USEC_INFINITY ||
- s->restart_usec >= s->restart_usec_max)
+ s->restart_max_delay_usec == USEC_INFINITY ||
+ s->restart_usec >= s->restart_max_delay_usec)
value = s->restart_usec;
else if (n_restarts_next > s->restart_steps)
- value = s->restart_usec_max;
+ value = s->restart_max_delay_usec;
else {
/* Enforced in service_verify() and above */
- assert(s->restart_usec_max > s->restart_usec);
+ assert(s->restart_max_delay_usec > s->restart_usec);
/* ((restart_usec_max - restart_usec)^(1/restart_steps))^(n_restart_next - 1) */
value = usec_add(s->restart_usec,
- (usec_t) powl(s->restart_usec_max - s->restart_usec,
+ (usec_t) powl(s->restart_max_delay_usec - s->restart_usec,
(long double) (n_restarts_next - 1) / s->restart_steps));
}
if (s->exit_type == SERVICE_EXIT_CGROUP && cg_unified() < CGROUP_UNIFIED_SYSTEMD)
log_unit_warning(UNIT(s), "Service has ExitType=cgroup set, but we are running with legacy cgroups v1, which might not work correctly. Continuing.");
- if (s->restart_usec_max == USEC_INFINITY && s->restart_steps > 0)
- log_unit_warning(UNIT(s), "Service has RestartSteps= but no RestartSecMax= setting. Ignoring.");
+ if (s->restart_max_delay_usec == USEC_INFINITY && s->restart_steps > 0)
+ log_unit_warning(UNIT(s), "Service has RestartSteps= but no RestartMaxDelaySec= setting. Ignoring.");
- if (s->restart_usec_max != USEC_INFINITY && s->restart_steps == 0)
- log_unit_warning(UNIT(s), "Service has RestartSecMax= but no RestartSteps= setting. Ignoring.");
+ if (s->restart_max_delay_usec != USEC_INFINITY && s->restart_steps == 0)
+ log_unit_warning(UNIT(s), "Service has RestartMaxDelaySec= but no RestartSteps= setting. Ignoring.");
- if (s->restart_usec_max < s->restart_usec) {
- log_unit_warning(UNIT(s), "RestartSecMax= has a value smaller than RestartSec=, resetting RestartSec= to RestartSecMax=.");
- s->restart_usec = s->restart_usec_max;
+ if (s->restart_max_delay_usec < s->restart_usec) {
+ log_unit_warning(UNIT(s), "RestartMaxDelaySec= has a value smaller than RestartSec=, resetting RestartSec= to RestartMaxDelaySec=.");
+ s->restart_usec = s->restart_max_delay_usec;
}
return 0;
fprintf(f,
"%sRestartSec: %s\n"
"%sRestartSteps: %u\n"
- "%sRestartSecMax: %s\n"
+ "%sRestartMaxDelaySec: %s\n"
"%sTimeoutStartSec: %s\n"
"%sTimeoutStopSec: %s\n"
"%sTimeoutStartFailureMode: %s\n"
"%sTimeoutStopFailureMode: %s\n",
prefix, FORMAT_TIMESPAN(s->restart_usec, USEC_PER_SEC),
prefix, s->restart_steps,
- prefix, FORMAT_TIMESPAN(s->restart_usec_max, USEC_PER_SEC),
+ prefix, FORMAT_TIMESPAN(s->restart_max_delay_usec, USEC_PER_SEC),
prefix, FORMAT_TIMESPAN(s->timeout_start_usec, USEC_PER_SEC),
prefix, FORMAT_TIMESPAN(s->timeout_stop_usec, USEC_PER_SEC),
prefix, service_timeout_failure_mode_to_string(s->timeout_start_failure_mode),
usec_t restart_usec;
unsigned restart_steps;
- usec_t restart_usec_max;
+ usec_t restart_max_delay_usec;
usec_t timeout_start_usec;
usec_t timeout_stop_usec;
usec_t timeout_abort_usec;