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

Re: $PATH and /etc/profile



Bob Proulx wrote:
> Simon L wrote:
> > When I log in text mode, the entire PATH is there as I want, I can 
> > "startx" and when I open a terminal, the PATH is perfect.
> > Now, if I start the computer with KDM and that I run a terminal, the 
> > PATH is only: "/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"
> By starting a login shell.  Create ~/.xsession with the following:
> 
>   #!/bin/bash --login
>   exec x-session-manager # or gnome-session or whatever.

AAAARG! you can't be serious!! .xsession as a LOGIN shell??

repeat after me... X windows is not your shell!

Simon, the reason you do not get your PATH set correctly is that if you login at
a console, /etc/profile will be read because it is a login shell. starting X
from there will inherit all your settings.

if however, you login via kdm/gdm/xdm, it is NOT a login shell, so /etc/profile
is not read. there are good reasons for this. if you do not agree with these
good reasons, then you can simply add the line
  . /etc/profile
to your ~/.xsession file.

doing as Bob suggests and changing your X login to a login shell is NOT the way
to solve this problem. the only reason his solution works is because in the
process of making X a login shell, /etc/profile will be sourced. in his solution
you will be seen to be logged in twice.

> P.S.  Does it seem like I answer this question about every other week?

i hope you aren't giving this advise to everyone!

cheers,
Sam
-- 
Free High School Science Texts
  http://www.nongnu.org/fhsst/
Sam's Homepages
  http://fommil.homeunix.org/~samuel/
  http://www.ma.hw.ac.uk/~samuel/

Attachment: pgp1GaUcxmaif.pgp
Description: PGP signature


Reply to: