From 9b1a094004639f9fb9a659110b4322663180b1a3eaa68ff1556530f69cbae674 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Wed, 12 May 2021 12:39:09 +0000 Subject: [PATCH] Accepting request 892440 from home:Vogtinator:plasma5.21 - Add patch to unbreak some services after login (kde#429415): * 0001-startkde-Reset-systemd-failed-units-on-login.patch OBS-URL: https://build.opensuse.org/request/show/892440 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=586 --- ...-Reset-systemd-failed-units-on-login.patch | 70 +++++++++++++++++++ plasma5-workspace.changes | 6 ++ plasma5-workspace.spec | 2 + 3 files changed, 78 insertions(+) create mode 100644 0001-startkde-Reset-systemd-failed-units-on-login.patch diff --git a/0001-startkde-Reset-systemd-failed-units-on-login.patch b/0001-startkde-Reset-systemd-failed-units-on-login.patch new file mode 100644 index 0000000..cbcb0e3 --- /dev/null +++ b/0001-startkde-Reset-systemd-failed-units-on-login.patch @@ -0,0 +1,70 @@ +From 40f69fbb53a3ffa6a9a71b172433a4fedcaf7a88 Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Thu, 8 Apr 2021 11:59:44 +0100 +Subject: [PATCH] [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 + +(cherry picked from commit b0997076c194b1cb72fc4380c8ebbe67b0ebc58a) +--- + startkde/startplasma.cpp | 12 ++++++++++++ + startkde/startplasma.h | 1 + + 2 files changed, 13 insertions(+) + +diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp +index c159035a0..4120582b5 100644 +--- a/startkde/startplasma.cpp ++++ b/startkde/startplasma.cpp +@@ -349,6 +349,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"), +@@ -390,6 +401,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 dcd6187f6..0e1ab08dc 100644 +--- a/startkde/startplasma.h ++++ b/startkde/startplasma.h +@@ -48,6 +48,7 @@ bool startPlasmaSession(bool wayland); + + void waitForKonqi(); + ++static void resetSystemdFailedUnits(); + static bool hasSystemdService(const QString &serviceName); + static bool useSystemdBoot(); + +-- +2.25.1 + diff --git a/plasma5-workspace.changes b/plasma5-workspace.changes index e41a93f..279c35f 100644 --- a/plasma5-workspace.changes +++ b/plasma5-workspace.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 12 09:49:28 UTC 2021 - Fabian Vogt + +- Add patch to unbreak some services after login (kde#429415): + * 0001-startkde-Reset-systemd-failed-units-on-login.patch + ------------------------------------------------------------------- Tue May 4 14:15:43 UTC 2021 - Fabian Vogt diff --git a/plasma5-workspace.spec b/plasma5-workspace.spec index ce1b513..f100715 100644 --- a/plasma5-workspace.spec +++ b/plasma5-workspace.spec @@ -42,6 +42,8 @@ Source1: https://download.kde.org/stable/plasma/%{version}/plasma-workspa Source2: plasma.keyring %endif Source3: baselibs.conf +# PATCH-FIX-UPSTREAM +Patch1: 0001-startkde-Reset-systemd-failed-units-on-login.patch # PATCHES 501-??? are PATCH-FIX-OPENSUSE Patch501: 0001-Use-qdbus-qt5.patch Patch502: 0001-Ignore-default-sddm-face-icons.patch