From 6bf0f408e4833152197fb38fb10a9989c89f3a59 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 9 Feb 2016 18:38:03 +0100 Subject: core: make the StartLimitXYZ= settings generic and apply to any kind of unit, not just services This moves the StartLimitBurst=, StartLimitInterval=, StartLimitAction=, RebootArgument= from the [Service] section into the [Unit] section of unit files, and thus support it in all unit types, not just in services. This way we can enforce the start limit much earlier, in particular before testing the unit conditions, so that repeated start-up failure due to failed conditions is also considered for the start limit logic. For compatibility the four options may also be configured in the [Service] section still, but we only document them in their new section [Unit]. This also renamed the socket unit failure code "service-failed-permanent" into "service-start-limit-hit" to express more clearly what it is about, after all it's only triggered through the start limit being hit. Finally, the code in busname_trigger_notify() and socket_trigger_notify() is altered to become more alike. Fixes: #2467 --- man/systemd.service.xml | 82 +++---------------------------------------------- man/systemd.unit.xml | 49 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 78 deletions(-) (limited to 'man') diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 4cd36ac70e..2145e33d05 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -873,86 +873,12 @@ effect. - - StartLimitInterval= - StartLimitBurst= - - Configure service start rate limiting. By - default, services which are started more than 5 times within - 10 seconds are not permitted to start any more times until the - 10 second interval ends. With these two options, this rate - limiting may be modified. Use - StartLimitInterval= to configure the - checking interval (defaults to - DefaultStartLimitInterval= in manager - configuration file, set to 0 to disable any kind of rate - limiting). Use StartLimitBurst= to - configure how many starts per interval are allowed (defaults - to DefaultStartLimitBurst= in manager - configuration file). These configuration options are - particularly useful in conjunction with - Restart=; however, they apply to all kinds - of starts (including manual), not just those triggered by the - Restart= logic. Note that units which are - configured for Restart= and which reach the - start limit are not attempted to be restarted anymore; - however, they may still be restarted manually at a later - point, from which point on, the restart logic is again - activated. Note that systemctl reset-failed - will cause the restart rate counter for a service to be - flushed, which is useful if the administrator wants to - manually start a service and the start limit interferes with - that. - - - - StartLimitAction= - - Configure the action to take if the rate limit - configured with StartLimitInterval= and - StartLimitBurst= is hit. Takes one of - , - , - , - , - , - or - . If - is set, hitting the rate limit will - trigger no action besides that the start will not be - permitted. causes a reboot following - the normal shutdown procedure (i.e. equivalent to - systemctl reboot). - causes a forced reboot which - will terminate all processes forcibly but should cause no - dirty file systems on reboot (i.e. equivalent to - systemctl reboot -f) and - causes immediate execution - of the - reboot2 - system call, which might result in data loss. Similarly, - , , - have the effect of - powering down the system with similar semantics. Defaults to - . - - FailureAction= - Configure the action to take when the service - enters a failed state. Takes the same values as - StartLimitAction= and executes the same - actions. Defaults to . - - - - RebootArgument= - Configure the optional argument for the - reboot2 - system call if StartLimitAction= or - FailureAction= is a reboot action. This - works just like the optional argument to systemctl - reboot command. + Configure the action to take when the service enters a failed state. Takes the same values as + the unit setting StartLimitAction= and executes the same actions (see + systemd.unit5). Defaults to + . diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index a95c160954..2d3274bbfb 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -759,6 +759,55 @@ system call. + + StartLimitInterval= + StartLimitBurst= + + Configure unit start rate limiting. By default, units which are started more than 5 times + within 10 seconds are not permitted to start any more times until the 10 second interval ends. With these two + options, this rate limiting may be modified. Use StartLimitInterval= to configure the + checking interval (defaults to DefaultStartLimitInterval= in manager configuration file, set + to 0 to disable any kind of rate limiting). Use StartLimitBurst= to configure how many + starts per interval are allowed (defaults to DefaultStartLimitBurst= in manager + configuration file). These configuration options are particularly useful in conjunction with the service + setting Restart= (see + systemd.service5); however, + they apply to all kinds of starts (including manual), not just those triggered by the + Restart= logic. Note that units which are configured for Restart= and + which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted + manually at a later point, from which point on, the restart logic is again activated. Note that + systemctl reset-failed will cause the restart rate counter for a service to be flushed, + which is useful if the administrator wants to manually start a unit and the start limit interferes with + that. + + + + StartLimitAction= + + Configure the action to take if the rate limit configured with + StartLimitInterval= and StartLimitBurst= is hit. Takes one of + , , , + , , or + . If is set, hitting the rate limit will trigger no + action besides that the start will not be permitted. causes a reboot following the + normal shutdown procedure (i.e. equivalent to systemctl reboot). + causes a forced reboot which will terminate all processes forcibly but should + cause no dirty file systems on reboot (i.e. equivalent to systemctl reboot -f) and + causes immediate execution of the + reboot2 system call, which + might result in data loss. Similarly, , , + have the effect of powering down the system with similar + semantics. Defaults to . + + + + RebootArgument= + Configure the optional argument for the + reboot2 system call if + StartLimitAction= or a service's FailureAction= is a reboot action. This + works just like the optional argument to systemctl reboot command. + + ConditionArchitecture= ConditionVirtualization= -- cgit v1.2.3-54-g00ecf