← Back to team overview

touch-packages team mailing list archive

[Bug 1468832] Re: lightdm sources .profile

 

In point of fact .xsession is supposed to be an executable shell script
with a shebang line, it's not supposed to be sourced at all, or at least
historically that has always been the case.  Theoretically the .xsession
file could be a C shell script so as long as it is executed instead of
sourced, this is not very interesting.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to lightdm in Ubuntu.
https://bugs.launchpad.net/bugs/1468832

Title:
  lightdm sources .profile

Status in lightdm package in Ubuntu:
  New

Bug description:
  It is a bug for any display manager to read .profile--you guys are
  absolutely killing me with this.  The user's .profile is to be read by
  the shell, on interactive shell (i.e. terminal) logins ONLY.  The man
  page for bash explains this in detail; it's also discussed in the dash
  man page.  The problem with display managers reading .profile is that
  it is the place where commands to set up your terminal (i.e. stty) go
  --this is the entire point of differentiating interactive shells from
  non-interactive shells, and it's the reason only interactive shells
  read .profile at all.  Currently, if you have any such commands in
  your .profile, lightdm barfs on them, delaying the login session and
  forcing you to click on a prompt.  This is extremely annoying (and
  wrong)!

  It would be satisfactory to make lightdm not display the errors, but
  that's the wrong solution.  There's already a decades-established
  method of getting X display managers to source your environment
  settings: the .xsession file.  It should be read by ALL display
  managers (or the session file that starts them).  If you have common
  environment settings you want set in all your shells, the correct way
  to handle this is:

  .bashrc:
  # set all common environment vars here
  ENV_VAR=foo
  ...

  .profile:
  # set up terminal
  stty erase
  # BASH already sources .bashrc by default on interactive sessions

  .xsession:
  if [ -f .bashrc ] source .bashrc

  If you're not using BASH, you can still use this method without
  changing anything, except in .profile you need to explicitly source
  the .bashrc file.  Of course you can change the name of the file that
  contains the common settings to reflect that your shell is not BASH;
  since the file is sourced by your other files explicitly, it does not
  matter what the user calls it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1468832/+subscriptions


References