Xsession does not invoke the correct shell profile script

Bug #1903334 reported by Ian Collier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdm3 (Ubuntu)
New
Low
Unassigned

Bug Description

The gdm3 package comes with a session launcher script /etc/gdm3/Xsession which starts
everything up. In that script it unconditionally executes $HOME/.profile (if it exists).
But this is not necessarily the correct shell startup file.

If your shell is bash and you have a .bash_login file, tty logins will use that and
never touch .profile; but logins via /etc/gdm3/Xsession won't execute .bash_login
and therefore will not set up your correct environment. If your shell is csh then
.profile was never in the picture and you need to instead execute .login and .cshrc
(which of course are in a different syntax that the /bin/bash which executes Xsession
won't understand).

I understand this file comes from upstream, so the bug should probably be filed upstream
as well. But Ubuntu doesn't have to include this Xsession in the gdm3 package and
could supply its own. (Red Hat have written their own and supply it in their xorg-x11-xinit
package; their gdm package simply symlinks that from /etc/gdm. They've solved the
profile problem by making the script execute: exec -l $SHELL -c "[command]" where
[command] is a shell command that starts up the session.)

In fact Ubuntu already does have a more comprehensive Xsession system included as part
of the x11-common package. So the Xsession supplied with gdm3 is redundant. (Unfortunately
that other Xsession also does not set up your environment correctly; it doesn't seem
to call any profile at all.)

Tags: focal
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, the bug would probably be best reported to Debian, a solution should be at least common between those distributions. Note that it would be better to stop using Xsession since that's not compatible with wayland sessions

Changed in gdm3 (Ubuntu):
importance: Undecided → Low
tags: added: focal
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.