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
Make qubes-session inherit the systemd user session variables. #151
Conversation
The standard environment.d facility is currently not respected in Qubes OS 4.1. This leads to inability to define environment variables when starting apps via qrexec¹. This should be fixed. Here is the fix — it is a fix that will not have any substantial performance impact (it runs *once*), and uses documented APIs to execute on the fix. ¹ Technically there's `/etc/profile.d` but that's meant to be used for **shells**. There is no guarantee that apps started via qrexec will inherit these variables.
I think better way is to enable pam_env.so
|
pam_env does not implement environment.d https://man7.org/linux/man-pages/man8/pam_env.8.html We may want to add that too, but that is a different enhancement request. |
Ouch, this is systemd routine which include /etc/environment. We use pam_env.so to setup env per qube via /home/user/.environment and global via /etc/environment. |
Not even sure that actually works, but I didn't try it. All I know is that the systemd user session implements If there is a technically more sound way of implementing it, then we should use that. |
Actually...
The programs started by |
Yeah qrexec-fork-server is going to need the same treatment. It's not clear to me what even starts it. |
It is started from qubes-session, you don't see it on the process tree because its parent exits in the meantime. |
AH! Then this fix is complete. What needs to be done before merging it? |
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.1&build=2022022513-4.1&flavor=pull-requests New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.1&build=2022021706-4.1&flavor=update
Failed tests55 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/35157#dependencies 5 fixed
Unstable tests
|
@Rudd-O thank you for the feedback. @andrewdavidwong we may add this tip somewhere in the doc? |
I'm thinking of a |
We welcome the addition of good external documentation links to the external documentation section of the table of contents. To add or update a link, please feel free to create a pull request against the documentation index. |
The standard environment.d facility is currently not respected in Qubes OS 4.1. This leads to inability to define environment variables when starting apps via qrexec¹.
This should be fixed. Here is the fix — it is a fix that will not have any substantial performance impact (it runs once), and uses documented APIs to execute on the fix. Furthermore, the fix enables packaged software to ship environment variables in
/usr/lib/environment.d
as per the standard, without which presumable at least some software will simply be broken.¹ Technically there's
/etc/profile.d
but that's meant to be used for shells. There is no guarantee that apps started via qrexec will inherit these variables, and that doesn't cover software packaging factory environment variable customization in/usr/lib/environment.d
.