summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-26 20:34:33 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-29 16:27:48 +0200
commit7629ec4642b03517742d09b7303c204fddf82108 (patch)
tree91b9cbfaa378ea199ff1f5e887a863e21243d548 /src/core/unit.c
parent8b26cdbd2a949b02c0f4d94d0e157cdb9438d246 (diff)
core: move start ratelimiting check after condition checks
With #2564 unit start rate limiting was moved from after the condition checks are to before they are made, in an attempt to fix #2467. This however resulted in #2684. However, with a previous commit a concept of per socket unit trigger rate limiting has been added, to fix #2467 more comprehensively, hence the start limit can be moved after the condition checks again, thus fixing #2684. Fixes: #2684
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index cb79c7c6b1..6c0684225a 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1497,11 +1497,6 @@ int unit_start(Unit *u) {
if (UNIT_IS_ACTIVE_OR_RELOADING(state))
return -EALREADY;
- /* Make sure we don't enter a busy loop of some kind. */
- r = unit_start_limit_test(u);
- if (r < 0)
- return r;
-
/* Units that aren't loaded cannot be started */
if (u->load_state != UNIT_LOADED)
return -EINVAL;
@@ -1543,6 +1538,11 @@ int unit_start(Unit *u) {
if (!UNIT_VTABLE(u)->start)
return -EBADR;
+ /* Make sure we don't enter a busy loop of some kind. */
+ r = unit_start_limit_test(u);
+ if (r < 0)
+ return r;
+
/* We don't suppress calls to ->start() here when we are
* already starting, to allow this request to be used as a
* "hurry up" call, for example when the unit is in some "auto