diff --git a/greeter/main.cpp b/greeter/main.cpp --- a/greeter/main.cpp +++ b/greeter/main.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -54,9 +55,12 @@ // exit gracefully to not leave behind screensaver processes (bug#224200) // return exit code 1 to indicate that a valid password was not entered, // to prevent circumventing the password input by sending a SIGTERM + + qDebug() << "Greeter received SIGTERM. Will exit with error."; instance->exit(1); break; case SIGUSR1: + qDebug() << "Greeter received SIGUSR1. Will lock immediately."; instance->lockImmediately(); break; } @@ -73,6 +77,8 @@ procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode); #endif + qDebug() << "Greeter is starting up."; + KLocalizedString::setApplicationDomain("kscreenlocker_greet"); // explicitly disable input methods as it makes it impossible to unlock, see BUG 306932 diff --git a/ksldapp.cpp b/ksldapp.cpp --- a/ksldapp.cpp +++ b/ksldapp.cpp @@ -213,33 +213,58 @@ auto finishedSignal = static_cast(&QProcess::finished); connect(m_lockProcess, finishedSignal, this, [this](int exitCode, QProcess::ExitStatus exitStatus) { + + qDebug() << "Greeter process exitted with status:" + << exitStatus << "exit code:" << exitCode; + if (m_isWayland && m_waylandDisplay && m_greeterClientConnection) { m_greeterClientConnection->destroy(); } - if ((!exitCode && exitStatus == QProcess::NormalExit) || s_graceTimeKill || s_logindExit) { + + const bool regularExit = !exitCode && exitStatus == QProcess::NormalExit; + if (regularExit || s_graceTimeKill || s_logindExit) { // unlock process finished successfully - we can remove the lock grab + + if (regularExit) { + qDebug() << "Unlocking now on regular exit."; + } else if (s_graceTimeKill) { + qDebug() << "Unlocking anyway due to grace time."; + } else { + Q_ASSERT(s_logindExit); + qDebug() << "Unlocking anyway since forced through logind."; + } + s_graceTimeKill = false; s_logindExit = false; doUnlock(); return; } - // failure, restart lock process + + qWarning() << "Greeter process exit unregular. Restarting lock."; + m_greeterCrashedCounter++; if (m_greeterCrashedCounter < 4) { // Perhaps it crashed due to a graphics driver issue, force software rendering now + qDebug("Trying to lock again with software rendering (%d/4).", + m_greeterCrashedCounter); setForceSoftwareRendering(true); startLockProcess(EstablishLock::Immediate); } else if (m_lockWindow) { + qWarning("Everything else failed. Need to put Greeter in emergency mode."); m_lockWindow->emergencyShow(); } + qCritical("Greeter process exitted and we could in no way recover from that!"); } ); connect(m_lockProcess, &QProcess::errorOccurred, this, [this](QProcess::ProcessError error) { if (error == QProcess::FailedToStart) { + qDebug() << "Greeter Process failed to start. Trying to directly unlock again."; doUnlock(); m_waylandServer->stop(); qCritical() << "Greeter Process not available"; + } else { + qWarning() << "Greeter Process encountered an unhandled error:" << error; } } ); @@ -608,6 +633,7 @@ // start the Wayland server int fd = m_waylandServer->start(); if (fd == -1) { + qWarning() << "Could not start the Wayland server."; emit m_lockProcess->errorOccurred(QProcess::FailedToStart); return; }