-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redesign login shell use in session scripts #1779
base: develop
Are you sure you want to change the base?
Conversation
Works as expected. Tested with bash, fish, csh and zsh. bash: fish: csh: zsh: |
If I understand it right, the environment from |
I think so. Might be possible to just source it unconditionally at the top and assume it won't be sourced again by sh compatible shells through some mechanism like |
We don't seem to have |
I don't know. The
and surrounds most code with |
This won't work on FreeBSD, unfortunately. I'm confused, why do we try to pull env from bash/fish/zsh at all if now we call |
As zsh doc said, if zsh is invoked with 'zsh', it will not source |
That means, if we source |
Tried to incorporate this in my Fedora Sericea build but to no avail, then I saw that the Fedora tests are not passing. Is there any work planned to get this working and into the main branch? |
The Fedora CI failures are for Fedora reasons, not SDDM reasons. |
I see, I haven't been able to pin-point exactly what those are, do you know? |
On clang internal compiler errors, i.e. compiler bugs. The current failures on develop are new, the CI workflow needs to be adjusted after fedora switched sddm to Qt 6 (I assume). |
I implemented a different approach which should work everywhere without noticable behaviour changes. Needs testing. |
It looks good to me, but I didn't test it at the runtime. |
Tested with fish and bash, works. |
Any activity? I had a bug that caused sddm to fail to load any session while using fish and this mr completly fixed the issue |
3cadac1
to
a025701
Compare
It's ready for merge, just needs approval from a maintainer. |
Meanwhile you could sync it with the base branch. Thanks for having put work in towards a solution! |
Avoid the re-import of variables into sh by using the user's login shell to invoke the session. For the wayland-session script it's straightforward: Just exec the session command directly within the login shell. For the Xsession script it's a bit more complex: The login shell environment has to be loaded first, then the xprofile files, so that they can overwrite the login shell environment. To achieve this, the script runs in two stages: The first uses the login shell to exec the second stage, which then reads xprofile and execs the session.
For what it's worth, I was really puzzled why sddm failed to create sessions on my system until I found and tested this PR. It does indeed fix the problem if your shell is fish. |
See #1768 (comment)
New approach, which does not suffer from the xprofile behaviour change:
Avoid the re-import of variables into sh by using the user's login shell
to invoke the session.
For the wayland-session script it's straightforward: Just exec the session
command directly within the login shell.
For the Xsession script it's a bit more complex: The login shell environment
has to be loaded first, then the xprofile files, so that they can overwrite
the login shell environment. To achieve this, the script runs in two stages:
The first uses the login shell to exec the second stage, which then reads
xprofile and execs the session.
Draft because only tested outside of a system installation so far.