]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: propagate service state to socket in more load states 14527/head
authorLennart Poettering <lennart@poettering.net>
Thu, 9 Jan 2020 10:51:40 +0000 (11:51 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 9 Jan 2020 10:53:26 +0000 (11:53 +0100)
It makes sense to filter state changes for some load states that
shouldn't happen, but the common cases should be accepted, because they
might happen during runtime when "systemctl daemon-reload" is issued and
unit files changed state in between. Otherwise we lose events.

Fixes: #4708
src/core/socket.c

index fc5ee69c9c90dcba61817a372390585a77aa5a54..c587eaebed5e2cb31e859a4fb6994b707b7a1221 100644 (file)
@@ -3257,7 +3257,12 @@ static void socket_trigger_notify(Unit *u, Unit *other) {
         assert(other);
 
         /* Filter out invocations with bogus state */
-        if (other->load_state != UNIT_LOADED || other->type != UNIT_SERVICE)
+        if (!IN_SET(other->load_state,
+                    UNIT_LOADED,
+                    UNIT_NOT_FOUND,
+                    UNIT_BAD_SETTING,
+                    UNIT_ERROR,
+                    UNIT_MASKED) || other->type != UNIT_SERVICE)
                 return;
 
         /* Don't propagate state changes from the service if we are already down */