From: Lennart Poettering Date: Mon, 2 May 2016 14:41:41 +0000 (+0200) Subject: core: don't propagate service state to sockets as long as there's still a job for... X-Git-Tag: v231~351^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d14e3a0de913cd5ef52693a9466129820322cff3;p=platform%2Fupstream%2Fsystemd.git core: don't propagate service state to sockets as long as there's still a job for the service queued --- diff --git a/src/core/socket.c b/src/core/socket.c index c500d12..d3d4866 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,