From 4f3a528ed3694aa7e619941c7f1493a81483588b Mon Sep 17 00:00:00 2001 From: Marc Ferland Date: Mon, 9 Sep 2024 10:40:51 -0400 Subject: [PATCH] systemd: always enable xdg-autostart option with kde Enabling the xdg-autostart option in systemd in recommended so that plasma and all related services can be started (and stopped) with systemd instead of relying on what is called the 'classic boot' model. This fixes an important issue for me where the platofrm would freeze for 90 seconds on restart or shutdown because of the kded6 daemon not quitting. See the following for an example: https://bugs.kde.org/show_bug.cgi?id=478313 As an added bonus, the sddm.service file can now be left as-is since it will get started automatically (it was already part of the graphics target). Signed-off-by: Marc Ferland --- .../images/core-image-plasma-bigscreen.bb | 2 ++ .../images/core-image-plasma-mobile.bb | 3 +++ recipes-support/sddm/sddm.inc | 3 --- recipes-support/systemd_%.bbappend | 12 ++++++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 recipes-support/systemd_%.bbappend diff --git a/recipes-integration/images/core-image-plasma-bigscreen.bb b/recipes-integration/images/core-image-plasma-bigscreen.bb index b9a27fe..f9112fc 100644 --- a/recipes-integration/images/core-image-plasma-bigscreen.bb +++ b/recipes-integration/images/core-image-plasma-bigscreen.bb @@ -21,3 +21,5 @@ IMAGE_INSTALL += " \ sddm-config-plasma-bigscreen \ packagegroup-plasma-bigscreen-workspace \ " + +SYSTEMD_DEFAULT_TARGET="graphical.target" diff --git a/recipes-integration/images/core-image-plasma-mobile.bb b/recipes-integration/images/core-image-plasma-mobile.bb index 8d7ea09..ed2e112 100644 --- a/recipes-integration/images/core-image-plasma-mobile.bb +++ b/recipes-integration/images/core-image-plasma-mobile.bb @@ -19,4 +19,7 @@ IMAGE_INSTALL = " \ sddm-config-plasma-mobile \ packagegroup-plasma-mobile \ " + +SYSTEMD_DEFAULT_TARGET="graphical.target" + inherit core-image diff --git a/recipes-support/sddm/sddm.inc b/recipes-support/sddm/sddm.inc index eac7763..c345fd4 100644 --- a/recipes-support/sddm/sddm.inc +++ b/recipes-support/sddm/sddm.inc @@ -69,9 +69,6 @@ do_install:append() { install -d ${D}${localstatedir}/lib/sddm chown -R sddm:sddm ${D}${localstatedir}/lib/sddm chmod 0750 ${D}${localstatedir}/lib/sddm - - # make SDDM actually auto-start - echo "WantedBy=multi-user.target" >> ${D}/${systemd_unitdir}/system/sddm.service } PACKAGES =+ " \ diff --git a/recipes-support/systemd_%.bbappend b/recipes-support/systemd_%.bbappend new file mode 100644 index 0000000..b7ed0b3 --- /dev/null +++ b/recipes-support/systemd_%.bbappend @@ -0,0 +1,12 @@ +# Enable the xdg-autostart option so .desktop files are automatically +# converted to systemd user services. If this option is not present, +# 'startplasma' falls back on 'classic boot' and this can cause issues +# like: +# +# https://bugs.kde.org/show_bug.cgi?id=478313 +# +# To get an idea of how plasma starts: +# +# https://github.com/KDE/plasma-workspace/blob/master/startkde/startplasma.cpp +# +PACKAGECONFIG:append = " xdg-autostart"