summaryrefslogtreecommitdiff
path: root/src/core/unit.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-09 18:38:03 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-10 13:26:56 +0100
commit6bf0f408e4833152197fb38fb10a9989c89f3a59 (patch)
tree5bbffa023ddcc7b5e8059a9d64e69e7d5303cb4e /src/core/unit.h
parentbae687d885dc9df257a23ab6aab08c579190fd53 (diff)
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
Diffstat (limited to 'src/core/unit.h')
-rw-r--r--src/core/unit.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/unit.h b/src/core/unit.h
index 8712e03133..a87ef74fb3 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -167,6 +167,11 @@ struct Unit {
/* Error code when we didn't manage to load the unit (negative) */
int load_error;
+ /* Put a ratelimit on unit starting */
+ RateLimit start_limit;
+ FailureAction start_limit_action;
+ char *reboot_arg;
+
/* Make sure we never enter endless loops with the check unneeded logic, or the BindsTo= logic */
RateLimit auto_stop_ratelimit;
@@ -230,6 +235,8 @@ struct Unit {
bool cgroup_members_mask_valid:1;
bool cgroup_subtree_mask_valid:1;
+ bool start_limit_hit:1;
+
/* Did we already invoke unit_coldplug() for this unit? */
bool coldplugged:1;
};