[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#752192: Need to source shell profile startup files into X environment



Package: x11-common
Version: 1:7.7+7
Severity: important

Currently, if you install LightDM+Xfce on Debian testing, log in to the
GUI, and open a shell in a terminal emulator, the shell will not have
any of the initializations from /etc/profile nor ~/.profile. One
noticeable effect is that if you have a ~/bin directory, it is not added
to your PATH (whereas this occurs due to the default ~/.profile when you
log in non-graphically).

In the past, the X display manager's startup scripts would source
/etc/profile and ~/.profile (possibly also /etc/xprofile and
~/.xprofile) so that the X session environment would have these
initializations, and then when the user opens a (non-login) shell in a
terminal emulator, everything's already there. On Ubuntu, LightDM does
exactly this in /usr/sbin/lightdm-session, line 23.

The maintainer of the lightdm package in Debian, however, has clearly
rejected this approach:

    https://bugs.debian.org/752129

The ~/.xsessionrc file may provide an answer to this, but this file is
not present unless the user creates it. Given that ~/.profile et al. are
already used out-of-the-box as a matter of standard practice, the
current behavior of Debian's X session is at least inconsistent (with
Debian itself as well as other distributions), and in terms of users'
expectations is assuredly a bug.

Since making LightDM do this is unlikely, one possible solution is to
create a new /etc/X11/Xsession.d/ script that sources ~/.profile et al.
into the X environment. If I recall correctly, an old version of gdm did
exactly this.

Another possible solution is to add a new /etc/skel/.xsessionrc file,
whose default incarnation does the profile sourcing. New users get
this file, and with it the expected profile-initialization behavior.
If they want to tweak the behavior, they can edit their copy to their
heart's content.

Here is the relevant excerpt from Ubuntu's /usr/sbin/lightdm-session
script. Somehow, somewhere, we need to do something similar:

    for file in "/etc/profile" "$HOME/.profile" "/etc/xprofile" "$HOME/.xprofile"; do
        if [ -f "$file" ]; then
            echo "Loading profile from $file";
            . "$file"
        fi
    done


Reply to: