team: ignore bus name appearance if we can't determine process id

If the GetConnectionUnixProcessID() call fails, the process that
registered on the bus has died and we should ignore the name
appearance event.
This commit is contained in:
Beniamino Galvani 2020-02-07 21:35:44 +01:00
parent 351644d7da
commit e94d76382c

View file

@ -380,11 +380,14 @@ teamd_dbus_appeared (GDBusConnection *connection,
if (pid != priv->teamd_pid)
teamd_cleanup (self, FALSE);
} else {
_LOGW (LOGD_TEAM, "failed to determine D-Bus name owner");
/* If we can't determine the bus name owner, don't kill our
* teamd instance. Hopefully another existing teamd just died and
* our instance will be able to grab the bus name.
*/
/* The process that registered on the bus died. If it's
* the teamd instance we just started, ignore the event
* as we already detect the failure through the process
* watch. If it's a previous instance that got killed,
* also ignore that as our new instance will register
* again. */
_LOGD (LOGD_TEAM, "failed to determine D-Bus name owner, ignoring");
return;
}
}