SUMMARY *** Trailing spaces from environment variables get stripped between startplasma-x11 and plasmashell *** Sorry, could not find the suitable category for plasma-workspace. Originally affected my $PS1 prompt variable. STEPS TO REPRODUCE 1. Put an export to /etc/profile (or profile.d/) with a trailing space: export XTEST=" xxx " 2. Login as the user 3. Open any terminal (for example Konsole+bash) and print the var: echo X${XTEST}X OBSERVED RESULT "X xxxX" EXPECTED RESULT "X xxx X" SOFTWARE/OS VERSIONS KDE Plasma Version: 5.26.5 KDE Frameworks Version: 5.102.0 Qt Version: 5.15.8 ADDITIONAL INFORMATION Not sure if this bug is systemd related (because plasma-plasmashell.service is involved). I've compared /proc/*/environ of plasmashell to startplasma-x11 and all trailing spaces are definitely missing. pids of both components are directly related. Directly sourcing the /etc/profile.d/file in a bash session works as expected. No suspicious systemd logs found. Env tracking in /usr/share/sddm/scripts/Xsession went "all good". Also affects a fresh Kubuntu 22.10 installation.
If you disable systemd boot by running `kwriteconfig5 --file startkderc --group General --key systemdBoot false` in a terminal window and then rebooting, does it still happen?
(In reply to Nate Graham from comment #1) > If you disable systemd boot by running `kwriteconfig5 --file startkderc > --group General --key systemdBoot false` in a terminal window and then > rebooting, does it still happen? Can confirm, "~/.config/startkderc" has been created with content: [General] systemdBoot=false Now it works as expected: /etc/profile.d/*: export TESTVAR=" xxx " echo x${TESTVAR}x "x xxx x" If related: I'm not using systemd-boot btw. rEFInd just calls vmlinuz.
In that case it's an issue in either systemd or our generator code. I'll leave it here for David Edmundson to triage further. Might also be intentional. In any event, relying on trailing spaces seems fragile.
(In reply to Nate Graham from comment #3) > Might also be intentional. In any event, relying on trailing spaces seems fragile. Stripping trailing white spaces for all environment variables feels worse. I don't have a better example than my $PS1 which already wasn't critical enough :-) Maybe a trailing LF is being stripped too? That could affect scripts in envs if the recommended LF on the last line is missing. Thank you for your time!
If it's a bug in our code, I think it's reasonable to fix it. I'm just trying to prepare you for a potential response of "this is intentional, deal with it" if it ends up being a Systemd issue.
I've just noticed my $PS1 correctly displays the trailing space again. So this bug seems to be fixed silently? If a dev did something, I would grant a RESOLVED. I did not test on Kubuntu, but my Arch machine is fine now. Thank you!
I don't think we made any changes here, so it was probably a systemd change/fix. Thanks a lot for following up!
Sorry, my bad... Forgot to undo "systemdBoot false". Bug still exists. I would dig into the KDE code to investigate, but I can't find the component.