https://bugs.kde.org/show_bug.cgi?id=522006

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #4 from [email protected] ---
I hit the same issue on KDE neon (Plasma 6.7.0) and found the root cause by
reading the source at tag v6.7.0. The same code is still present on current
master.

Autologin is only attempted when this condition holds
(src/daemon/Display.cpp, line 131 at v6.7.0):

    if ((PlasmaLogin::config()->autologinRelogin() ||
daemonApp->tryLockFirstLogin())
        && !PlasmaLogin::config()->autologinUser().isEmpty()) {

With Relogin at its default (false), everything depends on
DaemonApp::tryLockFirstLogin(). That function queries the
org.freedesktop.systemd1.Manager property "SoftRebootsCount" over D-Bus and
returns false on ANY error:

    if (reply.type() == QDBusMessage::ErrorMessage) {
        qWarning() << "DBus error:" << reply.errorName() << "-" <<
reply.errorMessage();
        return false;
    }

SoftRebootsCount was only added in systemd v257. On any distro shipping
systemd <= 256 (KDE neon is on Ubuntu 24.04 / systemd 255), the property Get
fails with org.freedesktop.DBus.Error.UnknownProperty, tryLockFirstLogin()
returns false, and autologin is silently skipped: the greeter is shown as if
no autologin were configured. The only trace is this early log line in the
journal, right after "Using VT 1":

    plasmalogin[...]: DBus error: "org.freedesktop.DBus.Error.UnknownProperty"
    - "Unknown interface org.freedesktop.systemd1.Manager or property
SoftRebootsCount."

Quick check on an affected system:

    busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 \
        org.freedesktop.systemd1.Manager SoftRebootsCount
    -> Failed to get property SoftRebootsCount ... Unknown interface ... 

Workaround, confirmed working on KDE neon: add Relogin=true to the
[Autologin] group, which short-circuits the tryLockFirstLogin() call:

    [Autologin]
    User=youruser
    Session=plasma.desktop
    Relogin=true

Suggested fix: treat UnknownProperty as "zero soft reboots" (fail open)
instead of failing closed — if systemd does not expose the counter, no soft
reboot can have happened. This would also explain why the feature works for
developers on systemd >= 257 but fails for reporters on Ubuntu-based distros.

Written by Claude Fable, since he was the one who found the bug and he explains
things better than I do :)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to