diff --git a/src/daemon/Auth.cpp b/src/daemon/Auth.cpp index c91e4f0..f825dfc 100644 --- a/src/daemon/Auth.cpp +++ b/src/daemon/Auth.cpp @@ -251,7 +251,7 @@ namespace DDM { QDBusConnection::systemBus()); auto reply = manager.GetSessionByPID(static_cast(sessionProcessId)); reply.waitForFinished(); - if (reply.error().isValid()) { + if (reply.isError()) { qWarning() << "[Auth] GetSessionByPID:" << reply.error().message(); return -1; } diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp index 809c800..da5d026 100644 --- a/src/daemon/Display.cpp +++ b/src/daemon/Display.cpp @@ -366,6 +366,20 @@ namespace DDM { Logind::managerPath(), QDBusConnection::systemBus()); manager.TerminateSession(QString::number(id)); + QTimer::singleShot(2000, this, [this, id]() { + OrgFreedesktopLogin1ManagerInterface manager(Logind::serviceName(), + Logind::managerPath(), + QDBusConnection::systemBus()); + // Some child processes may linger + // (e.g. gnome-keyring-daemon), kill them to avoid the + // whole session stuck in closing state. Send SIGKILL + // directly may make systemd-logind be left in a bad state + // and cannot handle future login, so send SIGTERM + // instead. + + // TODO: Find out why + manager.KillSession(QString::number(id), "all", 15); + }); } void Display::unlock(QLocalSocket *socket, const QString &user, const QString &password) {