summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-05-02 16:41:41 +0200
committerLennart Poettering <lennart@poettering.net>2016-05-02 16:41:41 +0200
commitd14e3a0de913cd5ef52693a9466129820322cff3 (patch)
tree0a1a64c6df9bcfa1b048bd7dd80169180737a771 /src
parentbd10a84b7ffaa61b83c3cfa46fc75c69b961c360 (diff)
core: don't propagate service state to sockets as long as there's still a job for the service queued
Diffstat (limited to 'src')
-rw-r--r--src/core/socket.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index c500d122d8..d3d4866fe6 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -2742,17 +2742,26 @@ static void socket_trigger_notify(Unit *u, Unit *other) {
assert(u);
assert(other);
- /* Don't propagate state changes from the service if we are
- already down or accepting connections */
- if (!IN_SET(s->state, SOCKET_RUNNING, SOCKET_LISTENING) || s->accept)
+ /* Filter out invocations with bogus state */
+ if (other->load_state != UNIT_LOADED || other->type != UNIT_SERVICE)
+ return;
+
+ /* Don't propagate state changes from the service if we are already down */
+ if (!IN_SET(s->state, SOCKET_RUNNING, SOCKET_LISTENING))
return;
+ /* We don't care for the service state if we are in Accept=yes mode */
+ if (s->accept)
+ return;
+
+ /* Propagate start limit hit state */
if (other->start_limit_hit) {
socket_enter_stop_pre(s, SOCKET_FAILURE_SERVICE_START_LIMIT_HIT);
return;
}
- if (other->load_state != UNIT_LOADED || other->type != UNIT_SERVICE)
+ /* Don't propagate anything if there's still a job queued */
+ if (other->job)
return;
if (IN_SET(SERVICE(other)->state,