From 22b893aeaa59d96961b11d7ad749c75b6aa758ec Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 6 May 2021 15:27:15 -0500 Subject: [PATCH] Reset systemd failed units on login (master/ branch backport) actually apply buffer types patch from -3 --- ...-Reset-systemd-failed-units-on-login.patch | 68 +++++++++++++++++++ plasma-workspace.spec | 9 ++- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 0279-startkde-Reset-systemd-failed-units-on-login.patch diff --git a/0279-startkde-Reset-systemd-failed-units-on-login.patch b/0279-startkde-Reset-systemd-failed-units-on-login.patch new file mode 100644 index 0000000..db82c3b --- /dev/null +++ b/0279-startkde-Reset-systemd-failed-units-on-login.patch @@ -0,0 +1,68 @@ +From b0997076c194b1cb72fc4380c8ebbe67b0ebc58a Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Thu, 8 Apr 2021 11:59:44 +0100 +Subject: [PATCH 279/382] [startkde] Reset systemd failed units on login + +If a service has recently failed multiple times, systemd will (quite +cleverly) not restart it. This includes DBus activation so is indepdent +of the systemd boot. + +If a service gets into a broken state on a previous session where ithas +different environment variables and a different display server, we +shouldn't treat it as failed for a new session. + +This shouldn't be needed with the other recent fixes, but it seems like +a good practice nevertheless. + +Gnome are doing something similar: +https://gitlab.gnome.org/GNOME/gnome-session/-/blob/master/gnome-session/main.c#L565 +--- + startkde/startplasma.cpp | 12 ++++++++++++ + startkde/startplasma.h | 1 + + 2 files changed, 13 insertions(+) + +diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp +index 778242538..997f91e88 100644 +--- a/startkde/startplasma.cpp ++++ b/startkde/startplasma.cpp +@@ -447,6 +447,17 @@ QProcess *setupKSplash() + return p; + } + ++// If something went on an endless restart crash loop it will get blacklisted, as this is a clean login we will want to reset those counters ++// This is independent of whether we use the Plasma systemd boot ++void resetSystemdFailedUnits() ++{ ++ QDBusMessage message = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"), ++ QStringLiteral("/org/freedesktop/systemd1"), ++ QStringLiteral("org.freedesktop.systemd1.Manager"), ++ QStringLiteral("ResetFailed")); ++ QDBusConnection::sessionBus().call(message); ++} ++ + bool hasSystemdService(const QString &serviceName) + { + auto msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"), +@@ -489,6 +500,7 @@ bool useSystemdBoot() + + bool startPlasmaSession(bool wayland) + { ++ resetSystemdFailedUnits(); + OrgKdeKSplashInterface iface(QStringLiteral("org.kde.KSplash"), QStringLiteral("/KSplash"), QDBusConnection::sessionBus()); + iface.setStage(QStringLiteral("kinit")); + // finally, give the session control to the session manager +diff --git a/startkde/startplasma.h b/startkde/startplasma.h +index 5283ed8e2..40a78a0c2 100644 +--- a/startkde/startplasma.h ++++ b/startkde/startplasma.h +@@ -51,6 +51,7 @@ bool startPlasmaSession(bool wayland); + + void waitForKonqi(); + ++static void resetSystemdFailedUnits(); + static bool hasSystemdService(const QString &serviceName); + static bool useSystemdBoot(); + +-- +2.31.1 + diff --git a/plasma-workspace.spec b/plasma-workspace.spec index 8580ab8..1bb70c0 100644 --- a/plasma-workspace.spec +++ b/plasma-workspace.spec @@ -14,7 +14,7 @@ Name: plasma-workspace Summary: Plasma workspace, applications and applets Version: 5.21.5 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ URL: https://invent.kde.org/plasma/%{name} @@ -67,6 +67,7 @@ Patch105: plasma-workspace-5.7.3-folderview_layout.patch ## upstream Patches (master branch) Patch0: plasma-workspace-announce-buffer-types-available-on-thumbnails-elements.patch +Patch279: 0279-startkde-Reset-systemd-failed-units-on-login.patch # udev BuildRequires: zlib-devel @@ -420,6 +421,8 @@ BuildArch: noarch %setup -q -a 20 ## upstream patches +%patch0 -p1 +%patch279 -p1 %patch100 -p1 -b .konsole-in-contextmenu # FIXME/TODO: it is unclear whether this is needed or even a good idea anymore -- rex @@ -723,6 +726,10 @@ desktop-file-validate %{buildroot}%{_kf5_datadir}/applications/org.kde.{klipper, %changelog +* Thu May 06 2021 Rex Dieter - 5.21.5-4 +- Reset systemd failed units on login (master/ branch backport) +- actually apply buffer types patch from -3 + * Wed May 05 2021 Jan Grulich - 5.21.5-3 - Announce which buffer types are available on thumbnails elements