core: don't propagate service state to sockets as long as there's still a job for...
authorLennart Poettering <lennart@poettering.net>
Mon, 2 May 2016 14:41:41 +0000 (16:41 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 2 May 2016 14:41:41 +0000 (16:41 +0200)
src/core/socket.c

index c500d12..d3d4866 100644 (file)
@@ -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,