diff options
Diffstat (limited to 'src/core/busname.c')
-rw-r--r-- | src/core/busname.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/busname.c b/src/core/busname.c index 335a1fdc4c..68508e20d2 100644 --- a/src/core/busname.c +++ b/src/core/busname.c @@ -21,6 +21,7 @@ #include <sys/mman.h> +#include "alloc-util.h" #include "bus-internal.h" #include "bus-kernel.h" #include "bus-policy.h" @@ -30,9 +31,12 @@ #include "fd-util.h" #include "formats-util.h" #include "kdbus.h" +#include "parse-util.h" +#include "process-util.h" #include "service.h" #include "signal-util.h" #include "special.h" +#include "string-table.h" #include "string-util.h" static const UnitActiveState state_translation_table[_BUSNAME_STATE_MAX] = { @@ -360,10 +364,9 @@ static int busname_coldplug(Unit *u) { if (n->deserialized_state == n->state) return 0; - if (IN_SET(n->deserialized_state, BUSNAME_MAKING, BUSNAME_SIGTERM, BUSNAME_SIGKILL)) { - - if (n->control_pid <= 0) - return -EBADMSG; + if (n->control_pid > 0 && + pid_is_unwaited(n->control_pid) && + IN_SET(n->deserialized_state, BUSNAME_MAKING, BUSNAME_SIGTERM, BUSNAME_SIGKILL)) { r = unit_watch_pid(UNIT(n), n->control_pid); if (r < 0) |