[neon/snap-packaging/plasma-core-desktop] /: Revert "Remove the cleanup-activation-environment step"

Kevin Ottens null at kde.org
Sun Aug 18 14:09:56 BST 2024


Git commit f11c04c9cd53db23d23a317605ac9fab3a8d6242 by Kevin Ottens.
Committed on 18/08/2024 at 13:08.
Pushed by ervin into branch 'master'.

Revert "Remove the cleanup-activation-environment step"

We need to wait for the startplasma patch to land in the neon packages

This reverts commit 608ee99afb060f5b178a1b863c78824117fb293e.

M  +18   -0    hooks/006-add-plasma-session.chroot
A  +27   -0    static/usr/bin/cleanup-activation-environment.sh

https://invent.kde.org/neon/snap-packaging/plasma-core-desktop/-/commit/f11c04c9cd53db23d23a317605ac9fab3a8d6242

diff --git a/hooks/006-add-plasma-session.chroot b/hooks/006-add-plasma-session.chroot
index 40858af..7d786cb 100755
--- a/hooks/006-add-plasma-session.chroot
+++ b/hooks/006-add-plasma-session.chroot
@@ -182,3 +182,21 @@ sed -i "/^ReadWritePaths=/ a \\  /var/lib/extrausers/ \\\\" \
 rm /usr/sbin/NetworkManager
 rm /usr/lib/systemd/system/NetworkManager*.service
 
+# Clean up the systemd and dbus activation environment at beginning
+# of startup (just after startplasma pushed its own environment)
+# this is necessary to avoid the desktop-launch routine wrongfully
+# thinking it's run from a confined snap
+cat >/usr/lib/systemd/user/plasma-env-cleanup.service<<EOF
+[Unit]
+Description=KDE Plasma Activation Environments Cleanups
+PartOf=graphical-session.target
+Before=plasma-kwin_wayland.service
+
+[Service]
+ExecStart=/usr/bin/cleanup-activation-environment.sh
+Type=oneshot
+Slice=session.slice
+EOF
+
+mkdir /usr/lib/systemd/user/plasma-workspace-wayland.target.wants
+ln -s /usr/lib/systemd/user/plasma-env-cleanup.service /usr/lib/systemd/user/plasma-workspace-wayland.target.wants
diff --git a/static/usr/bin/cleanup-activation-environment.sh b/static/usr/bin/cleanup-activation-environment.sh
new file mode 100755
index 0000000..8978473
--- /dev/null
+++ b/static/usr/bin/cleanup-activation-environment.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+set -x
+
+dbus-update-activation-environment --systemd SNAP="" _KDE_APPLICATIONS_AS_FORKING=1
+
+systemctl --user unset-environment \
+    SNAP \
+    SNAP_ARCH \
+    SNAP_COMMON \
+    SNAP_CONTEXT \
+    SNAP_COOKIE \
+    SNAP_DATA \
+    SNAP_EUID \
+    SNAP_INSTANCE_KEY \
+    SNAP_INSTANCE_NAME \
+    SNAP_LIBRARY_PATH \
+    SNAP_NAME \
+    SNAP_REAL_HOME \
+    SNAP_REEXEC \
+    SNAP_REVISION \
+    SNAP_SAVE_DATA \
+    SNAP_UID \
+    SNAP_USER_COMMON \
+    SNAP_USER_DATA \
+    SNAP_VERSION
+



More information about the Neon-commits mailing list