You are not logged in.
Hey archers,
I am using Gnome with Wayland and GDM.
/etc/profile does not get sourced as to my understanding Wayland does not utilize a login shell, resulting in an incomplete $PATH since the environment variables aren't set. How do you guys solve that?
Does anybody know how Fedora 25 handles it?
Offline
After update, my .Xresources was not loaded on startup.
Also using Gnome and GDM.
Uncommented the WaylandEnable=false in /etc/gdm/custom.conf and then the resources was loaded.
Dont know what is going on with Wayland.
Last edited by TheDemz (2016-10-13 21:00:42)
Offline
OP, this is https://bugzilla.gnome.org/show_bug.cgi?id=736660.
After the Wayland update yesterday, I just moved my personal additions (e.g. add ~/bin to PATH) from ~/.profile to ~/.bashrc. Not sure if this is the best fix.
Offline
Well, this can be a pretty serious problem I think... even if you not changed anything by yourself there are a couple of paths missing (i.e. if you have Java installed)
For me:
Wayland $PATH: /usr/local/bin:/usr/local/sbin:/usr/bin
Xorg $PATH: /usr/lib/hardening-wrapper/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
So... any package related PATH setting is gone under a Wayland session. I think ArchLinux should react somehow instead of leaving users with incomplete environments.
Last edited by -MacNuke- (2016-10-14 01:44:01)
Offline
This works! Thank you for saving me from being not able to use IM (input method, configured in ~/.xprofile)!
After update, my .Xresources was not loaded on startup.
Also using Gnome and GDM.
Uncommented the WaylandEnable=false in /etc/gdm/custom.conf and then the resources was loaded.
Dont know what is going on with Wayland.
arch x86_64 on Dell E7450
Offline
While this works, that's hardly a solution, is it?
Offline
I can source it manually in bash with
for file in /etc/profile.d/*.sh; do source "${file}"; done
But some of my launchers disappear because gnome cannot find the command, and any program starting from gnome won't get the envs.
Offline
Environment variables
For setting up session-wide environment variables, gdm supports the /usr/share/gdm/env.d/ drop-in directory. Files dropped in there are text files containing a series of VARIABLE=VALUE assignments.
A complication with environment variables is that both systemd -user and D-Bus have their own 'activation environments': the environments that are inherited by the services they start. Use dbus-update-activation-environment --systemd DISPLAY LANG WHATEVER or dbus-update-activation-environment --systemd --all to update both.
Starting session services
For starting services, there are various alternatives: D-Bus activation, systemd user services, xdg autostart files. Autostart files and systemd services can have conditions that control their activation.
https://wiki.gnome.org/Initiatives/Wayland/SessionStart
So to run a script per user, create a user specific systemd ?
If any could make an example would be awesome.
https://wiki.archlinux.org/index.php/Systemd/User
Check if it realy is a wayland GDM session ?
X-GDM-Session-Type=wayland
Offline
Provide means to handle user environment configuration
At the moment there's no good answer for users who want to set
environment variables for their session. Users have in the past used
their .bashrc or .bash_profile to accomplish this task, but sourcing
a tower of shell scripts at login time is suboptimal, so wayland
sessions aren't run through a login shell.Some distributions use pam_env, but the way it's set up from distro to
distro varies, and its file format is strange.See https://bugzilla.gnome.org/show_bug.cgi?id=736660
Furthermore, services themselves may want to affect the user session
environment. flatpak, for instance, needs to modify XDG_DATA_DIRS to
work correctly. There's no good way to achieve this at the moment.See alexlarsson/xdg-app#147
This patchset tries to solve the problem in systemd by:
Augmenting the DefaultEnvironment option of user.conf to have a new
DefaultEnvironmentFile next to it. It follows the same format as
EnvironmentFile inside service files.Augmenting user.conf to support certain specifiers. This is needed
to allow %h (the home dir) to be referenced from user.confAugmenting EnvironmentFile (and DefaultEnvironmentFile) to support
environment variable expansion using the ${VAR} format. This is
handled in a backward compatible way by requiring the glob pattern to
be prefixed with a special character (':').For symmetry, augmenting Environment (and DefaultEnvironment) to
support environment variable expansion if a ':' prefix is provided.Shipping a default user.conf.d snippet that configures user sessions
to read environment variables from:/etc/environment (to take over from pam_env)
~/.config/environment.d (to give the user a place to put additions)
/usr/lib/environment.d (to give services a place to put additions)Changing pam_systemd to import the systemd --user environment into
sessions as they get opened.
Offline
https://wiki.archlinux.org/index.php/En … ng_pam_env
~/.pam_environment
XENVIRONMENT DEFAULT=@{HOME}/.Xresources
By setting the environment variable per user, the .Xresources is available again.
Offline
I realize a bit late, but until upstream formally decides on a unified method, exact old behavior can be obtained by modifying gnome-session (it's just a shell script). Discussed it with another dev last night, and I think the KISS method is likely to win out in our little camp for the time being. That said, it'll probably be decided tomorrow now that I finally found this thread again and posted this! :-) Could use /etc/gdm/Xsession as a guide (don't source directly though, that's GDM's environment, not a user's).
HTH
Offline
Note that `/etc/profile.d` has been working now with GNOME 3.22.2.
Sorry for being misleading, it might be because of my switching back to Xorg due to another issue.
Last edited by Dreaming in Code (2016-11-29 02:40:50)
Offline
Are you sure it works now? Do I miss something here? It does not work for me. My PATH is still "/usr/local/bin:/usr/local/sbin:/usr/bin".
Last edited by -MacNuke- (2016-11-22 15:49:28)
Offline
Are you sure it works now? Do I miss something here? It does not work for me. My PATH is still "/usr/local/bin:/usr/local/sbin:/usr/bin".
I just came here because it suddenly started working for me . I think you might have your path setup statically somewhere and you need to remove it. For example, oh-my-zsh sets a static PATH on update, hence if you updated while having the previous version running, you will end up with the wrong static PATH. Check also your /etc/environment and ~/.pam_environment files. For me it works really well now.
Sorry, it does not work for me either. I was logged in through Xorg. Can the people for which it works give some details on their setup?
Last edited by kgizdov (2016-11-28 15:42:11)
Offline
Are there any updates on this? It's a pretty major bug.
Offline
Did you try looking at the upstream bug (linked here before) ...?
https://bugzilla.gnome.org/show_bug.cgi?id=736660
Offline
@seth, I just had a look again at that thread and tried the last solution. It seems to work. I will test for a few days before sticking with it, but I think for now I am satisfied. What I did was this:
--- /usr/bin/gnome-session.old 2016-12-22 14:30:16.118497829 +0000
+++ /usr/bin/gnome-session 2016-12-22 14:35:16.069513827 +0000
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/zsh -l
SETTING=$(gsettings get org.gnome.system.locale region)
REGION=${SETTING#\'}
Obviously, this assumes you are using ZSH as your user shell.
Last edited by kgizdov (2016-12-22 14:56:03)
Offline
@seth, I just had a look again at that thread and tried the last solution. It seems to work. I will test for a few days before sticking with it, but I think for now I am satisfied. What I did was this:
--- /usr/bin/gnome-session.old 2016-12-22 14:30:16.118497829 +0000 +++ /usr/bin/gnome-session 2016-12-22 14:35:16.069513827 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/zsh -l SETTING=$(gsettings get org.gnome.system.locale region) REGION=${SETTING#\'}
Obviously, this assumes you are using ZSH as your user shell.
Thanks, I had the same problem and with your solution, it works well now.
Offline
Hey there I'm having the same issue here.
Environment variables
For setting up session-wide environment variables, gdm supports the /usr/share/gdm/env.d/ drop-in directory. Files dropped in there are text files containing a series of VARIABLE=VALUE assignments.
From this page : Wayland Session start
Did anyone give that solution a try ? As I understand this, you can set session wide environment variables from within that file although I quite don't see how it's possible to have some user-specific environment variables.
Or maybe someone solved that issue ?
Offline
Or maybe someone solved that issue ?
This is my temporary solution to this problem until the GNOME devs fix it properly. See https://github.com/rmarquis/pacaur/issu … -277485530.
Offline