core: add RestartSteps= and RestartSecMax= for exponentially increasing

interval between restarts

RestartSteps= accepts a positive integer as the number of steps
to take to increase the interval between auto-restarts from
RestartSec= to RestartSecMax=, or 0 to disable it.

Closes #6129
This commit is contained in:
Mike Yuan
2023-03-27 19:31:12 +08:00
parent f447b74185
commit be1adc27fc
7 changed files with 99 additions and 4 deletions
+12
View File
@@ -2564,6 +2564,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t RestartUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly u RestartSteps = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t RestartUSecMax = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t TimeoutStartUSec = ...;
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly t TimeoutStopUSec = ...;
@@ -3188,6 +3192,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
<!--property RestartUSec is not documented!-->
<!--property RestartSteps is not documented!-->
<!--property RestartUSecMax is not documented!-->
<!--property TimeoutStartFailureMode is not documented!-->
<!--property TimeoutStopFailureMode is not documented!-->
@@ -3746,6 +3754,10 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
<variablelist class="dbus-property" generated="True" extra-ref="RestartUSec"/>
<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="TimeoutStartUSec"/>
<variablelist class="dbus-property" generated="True" extra-ref="TimeoutStopUSec"/>
+19
View File
@@ -610,6 +610,25 @@
as "5min 20s". Defaults to 100ms.</para></listitem>
</varlistentry>
<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>.
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>
</varlistentry>
<varlistentry>
<term><varname>RestartSecMax=</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>
to disable the setting. Defaults to <literal>infinity</literal>.</para>
<para>This setting is effective only if <varname>RestartSteps=</varname> is also set.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>TimeoutStartSec=</varname></term>
<listitem><para>Configures the time to wait for start-up. If a daemon service does not signal