GDM 3.0 and higher ignores /etc/environment

Bug #844103 reported by Brian Murray
64
This bug affects 13 people
Affects Status Importance Assigned to Milestone
gdm
Fix Released
Wishlist
gdm (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

When I login in via gdm /sbin is not in my $PATH.

10:07:37 - flash:[~] echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/home/bdmurray/bin/:/home/bdmurray/bin/

However, if I ssh to my system it is set:

10:13:38 - flash:[~] ssh localhost
bdmurray@localhost's password:
bdmurray@flash:[~] echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/home/bdmurray/bin/

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gdm 3.0.4-0ubuntu9
ProcVersionSignature: Ubuntu 3.0.0-10.16-generic 3.0.4
Uname: Linux 3.0.0-10-generic x86_64
Architecture: amd64
CheckboxSubmission: fee5e196cb921cbd36888f428b38b488
CheckboxSystem: 2a6f54df59af338184485e85cbcf0d32
Date: Wed Sep 7 10:06:24 2011
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/zsh
SourcePackage: gdm
UpgradeStatus: Upgraded to oneiric on 2011-09-06 (1 days ago)

Revision history for this message
Brian Murray (brian-murray) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

When debugging this with cjwatson he was curious about the following:

bdmurray 2592 0.0 0.0 267436 3216 ? Ssl Sep06 0:00 gnome-session --session=ubuntu GNOME_KEYRING_PID=2546 USER=bdmurray COMPIZ_CONFIG_PROFILE=ubuntu HOME=/home/bdmurray XDG_SESSION_COOKIE=b2b609e7925d3336a84af60045ddb693-1315329020.333531-1093409211 DESKTOP_SESSION=ubuntu GTK_MODULES=canberra-gtk-module:canberra-gtk-module UBUNTU_MENUPROXY=libappmenu.so GNOME_KEYRING_CONTROL=/tmp/keyring-y9M5fi MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path LOGNAME=bdmurray DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path USERNAME=bdmurray WINDOWPATH=7 QT_GRAPHICSSYSTEM=raster GDM_LANG= PATH=/usr/local/bin:/usr/bin:/bin:/usr/games DISPLAY=:0 LANG=en_US.UTF-8 XAUTHORITY=/var/run/gdm/auth-for-bdmurray-R9vBO8/database SHELL=/bin/zsh GDMSESSION=ubuntu IPVIEWER=3.0.0.20 PWD=/home/bdmurray XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/ IPVIEWER_PATH=/usr/lib/IPViewer SSH_AUTH_SOCK=/tmp/ssh-BpnUKrWn2592/agent.2592 SSH_AGENT_PID=2656 DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-NSnEpcPBnn,guid=087d93f81c7028b9d0eadd1400000072

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdm (Ubuntu):
status: New → Confirmed
tags: added: precise
Revision history for this message
Václav Šmilauer (eudoxos) wrote :

I have to dispute the package assignment. Running precise after upgrade from oneiric (which itself was an upgrade from debian stable, therefore perhaps with non-standard settings), I bumped into such problems. I notice /etc/profile sets /sbin and /usr/sbin only if `id -u` == 0, not for regular users, in case it might be related.

Revision history for this message
Reuben Thomas (rrt) wrote :

The default /etc/profile does nothing of the sort; indeed, it doesn't even mention PATH.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

This has been fixed for Ubuntu 12.10 Alpha "Quantal Quetzal".

If anyone wants this fixed in previous versions, it's a one-line fix in debian/rules and then recompile
- --with-default-path=/usr/local/bin:/usr/bin:/bin:/usr/games \
+ --with-default-path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games \

Changed in gdm (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Reuben Thomas (rrt) wrote :

Thanks very much for the fix and the workaround!

However, it looks as though there's an underlying problem, namely that gdm's default PATH is hardwired, not read from system settings. If /etc/login.defs changes (or the user changes it), this bug will reoccur. The (duplicate bug) #978259 discusses this, and suggests a fix (comment #4). This might be sufficient for Ubuntu, even if not for the general case. I filed an upstream bug for the general case here:

https://bugzilla.gnome.org/show_bug.cgi?id=682907

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Thanks, Reuben. I'm reopening this bug then as the root problem still exists. Thanks for opening the GNOME bug.

summary: - /sbin not in $PATH
+ GDM 3.0 and higher ignores /etc/environment
Changed in gdm (Ubuntu):
status: Fix Released → Triaged
importance: Undecided → Low
Changed in gdm:
importance: Unknown → Wishlist
status: Unknown → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm - 3.5.91-0ubuntu1

---------------
gdm (3.5.91-0ubuntu1) quantal; urgency=low

  * New upstream bugfix release.
  * debian/control.in:
    - Revert dependency on gnome-shell; no longer needed
    - Build-depend on yelp-tools instead of gnome-doc-utils
    - Bump minimum glib
    - Drop build-depends on libxklavier-dev
  * debian/rules:
    - Add --with-authentication-agent-directory=/usr/lib/policykit-1-gnome
    - Drop --with-default-path, not needed as /etc/environment
      works correctly now (LP: #844103)
  * debian/patches/10_no_gettext.patch:
    - Don't run gettext since it conflicts with intltool
  * debian/patches/94_fix_greeter_not_disappearing.patch:
    - Fix login screen still displaying after logon when using
      gdm in fallback mode (LP: #1046601)
 -- Jeremy Bicha <email address hidden> Wed, 05 Sep 2012 19:00:10 -0400

Changed in gdm (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
sefs (sefsinc) wrote :

This bug is present and unfixed on Precise 12.04 is there a fix for it?

Revision history for this message
Reuben Thomas (rrt) wrote :

@sefs, see fix in comment #6, which involves rebuilding gdm.

Revision history for this message
Andreas Heinlein (aheinlein) wrote :

A workaround without rebuilding gdm is to create a new file /etc/profile.d/gdm-fix.sh and copy the PATH definition from /etc/environment there.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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