SUMMARY *** Discover offline updates with restart option enabled skips user logout script(s), which can be important for the user, like checking something that will be lost when computer is restarted. *** STEPS TO REPRODUCE 1. Use a logout script, e.g. containing a yesno kdialog. 2. Tick the restart option box at the bottom of Updates window. 3. Perform the updates. OBSERVED RESULT Computer restarts without executing the user logout script. EXPECTED RESULT The user logout script should be executed as in other cases of performing restart (qdbus org.kde.ksmserver /KSMServer logout 0 1 3) SOFTWARE/OS VERSIONS Operating System: KDE neon 5.24 KDE Plasma Version: 5.24.3 KDE Frameworks Version: 5.91.0 Qt Version: 5.15.3
Looks like this is because the DiscoverObject::rebootNow() function does the following: auto method = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.login1"), QStringLiteral("/org/freedesktop/login1"), QStringLiteral("org.freedesktop.login1.Manager"), QStringLiteral("Reboot")); Notably it bypasses ksmserver and just uses the freedesktop thing, which is why logout scripts would be skipped. Should be a relatively easy fix. Would you be interested in submitting a merge request to change it to the other dbus call that you mentioned?
(In reply to Nate Graham from comment #1) I wish I could with my elementary scripting skills (nowhere close to programming) . I could only find that block in file "/master/discover/DiscoverObject.cpp" but I have no idea how and where exactly the command "qdbus org.kde.ksmserver /KSMServer logout 0 1 3" should replace the freedesktop thing.
It does it interactively now, which goes through ksmserver, which fixes the issue.