Skip to content
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

gnome3.gdm: Always reset the environment for new sessions #48517

Merged
merged 1 commit into from Oct 19, 2018

Conversation

hedning
Copy link
Contributor

@hedning hedning commented Oct 16, 2018

Motivation for this change

When GDM launches a new session it will inherit the user's systemd
environment (but only unset variables). If __NIXOS_SET_ENVIRONMENT_DONE is set
in the user's systemd environment it will prevent the environment to be set
properly or updated (eg. after having done a system rebuild).

Gnome sessions exports their environment to systemd at startup. If something
is keeping the user's systemd process alive (eg. ssh) launching a new gnome
session after logging out will result in a broken PATH. Specifically the PATH
will be inherited from GDM and never reset.

We patch GDM to never inherit __NIXOS_SET_ENVIRONMENT_DONE so new sessions
will always reset their base environment.

fixes #48255

For more info about the environment setup:
#45784

cc @jtojnar

The issue is also present in 18.09 so this fix should be backported.

Things done

Tested in a VM that logging into a new gnome session works properly when ssh is active after logging out once.


When GDM launches a new session it will inherit the user's systemd
environment (but only unset variables). If `__NIXOS_SET_ENVIRONMENT_DONE` is set
in the user's systemd environment it will prevent the environment to be set
properly or updated (eg. after having done a system rebuild).

Gnome sessions exports their environment to systemd at startup. If something
is keeping the user's systemd process alive (eg. ssh) launching a new gnome
session after logging out will result in a broken PATH. Specifically the PATH
will be inherited from GDM and never reset.

We patch GDM to never inherit `__NIXOS_SET_ENVIRONMENT_DONE` so new sessions
will always reset their base environment.

fixes NixOS#48255

For more info about the environment setup:
NixOS#45784
@GrahamcOfBorg GrahamcOfBorg added 6.topic: GNOME GNOME desktop environment and its underlying platform 10.rebuild-darwin: 0 10.rebuild-linux: 11-100 labels Oct 16, 2018
@oxij
Copy link
Member

oxij commented Oct 19, 2018

Looks very hacky, but I guess it's the lesser of several possible evils. LGTM.

@jtojnar jtojnar merged commit c857cf9 into NixOS:master Oct 19, 2018
@jtojnar
Copy link
Contributor

jtojnar commented Oct 19, 2018

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: GNOME GNOME desktop environment and its underlying platform 10.rebuild-darwin: 0 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gnome3 loses contents of "default" profile
4 participants