2

After upgrading Ubuntu from 17.04 to 17.10, ~/.profile file has suddenly stopped running on login. Therefore, the script below, which is located in ~/.profile isn't run

# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"

How to make ~/.profile run again on startup? Thanks in advance!

5
  • Is it sourced if you select a gnome session (in place of the default - I think -Wayland session)? – steeldriver Jan 27 '18 at 23:25
  • @steeldriver good question. Just checked: when I choose "Ubuntu" (default) it doesn't work, but when I choose "Ubuntu on Xorg" or "Unity" it does work. – AlonL Jan 27 '18 at 23:32
  • Yeah - I think that's just a "feature" of the Wayland session (it doesn't invoke a login shell) - not sure if there's a way to change that – steeldriver Jan 27 '18 at 23:33
  • @steeldriver seems awkward to me, many thanks anyway. – AlonL Jan 27 '18 at 23:35
  • Some suggestions here: GNOME, Wayland, and environment variables – steeldriver Jan 27 '18 at 23:40
4

The issue is that Ubuntu 17.10 uses Wayland as the default desktop session - which unlike traditional X-Windows desktops, does not invoke a user's login shell (or in fact any shell).

The recommended workaround from Initiatives/Wayland/Session Start GNOME Wiki is given as follows:

The simplest way to set environment variables for a single user under systemd (version 233 or later), is to create a .conf file in ~/.config/environment.d, containing lines of the form NAME=VAL. See the environment.d documentation for more details.

GDM also supports the /usr/share/gdm/env.d/ drop-in directory. Files dropped in there also contain lines of the form NAME=VAL. These affect all users of the system.

For additional discussion see the article GNOME, Wayland, and environment variables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.