readonly export + Fish combination
I'm posting here to continue the conversation from #1331
In openSUSE Tumbleweed, /etc/profile has a readonly export, PROFILEREAD
#1331 adds sourcing of /etc/profile and ~/.profile for Fish in both Xorg and Wayland. Due to the way it's implemented, the variables are being sourced twice, both times include the readonly variable
I'm not getting the issue in Xorg because a different script is being used (/usr/etc/X11/xdm/Xsession)
It can be reproduced by running:
fish$ sh # which is a symlink to bash
sh$ . /etc/profile
sh$ . <(export -p)
Here are some ideas on how to handle this:
- Do nothing, and expect distro and system maintainers to patch it accordingly. Is it safe to assume that a readonly variable will not be exported by a third party program in
/etc/profile.d/? - Use
diffso the second sourcing will only include changed variables - Use
declare -pxinstead ofexport -p, causing the readonly export to become writable, which can't be a good idea I tried to grep the results ofdeclare -pinstead, but I went into an issue wherePROFILEREADwas still-xinstead of-rx
In the meantime, openSUSE Fish users can add export -n PROFILEREAD to ~/.profile
In the meantime, openSUSE Fish users can add export -n PROFILEREAD to ~/.profile
😍 Last 2 times I've updated my openSUSE I couldn't start wayland session and have pain figuring out why (I update my old laptop once or twice a year). Thanks for posting the workaround which doesn't involve changing system files. 🙇♂️
The problem has now reached other users as well, e.g. the Opensuse Leap users using the additional KDE repositories and other shells (as the previous mentions show). So I guess that option 1) (do nothing) is not a good thing. Which leaves option 2) (diff) or a different solution.
Thanks for the workaround for fish, it works for me!
https://github.com/sddm/sddm/pull/1779 fixes this.
I can confirm this patch worked for me on NixOS.