When the system is configured to enter init 5 automatically upon boot and
you log in as root, the path is different compared to logging in at a
different terminal, or logging in when booting to init 3. The /usr/sbin
directory is left off of the path.
Are you logging in to xdm/gdm/kdm as root? Or are you loggin into X as
a user and then either ssh'ing or su'ing to root? I could not
replicate this problem. If I start in runlevel 5, and log in as root,
then open an xterm, I don't have this problem.
Can you give me the exact specifics of your X configuration, GDM/KDM, etc.
and instructions on replicating the problem including all programs executed,
My system by default boots up in as init 3. If I log in as the root account
and do an export, my PATH
If I now run 'init 5' (boots into KDE, so must be KDM I am assuming), my PATH
is /bin:/bin:/usr/bin:/usr/X11R6/bin:/opt/kde2/bin:/usr/lib/kde2. If I set my
system to boot into runlevel 5 and reboot the system, I get the latter path as
well. Could this be something with KDE? I have verified this on 2 machines.
Another note, when in X, I am checking the path from a terminal created by the
icon on the KDE bar.
Bero, could you look into this, it looks like it may be a KDM problem. I
can't find how the path gets set in the KDM case, and so I'm not sure where
a fix would be. I also haven't replicated it yet.
I think this is the same as my problem. I am using KDE (RedHat 7.0) but I have
the same problem if I try Gnome.
If I use the graphical login (run level5) the /etc/profile and ~/bash_profile
files do not seem to be read and any alterations to the PATH made in them are
not reflected in the bash shell when running a printenv command. However this
applies to any user and not just root.
If I don't use the graphical login and start the machine in run level 3, then
all is well and the files are read.
It seems like the shells are never login shells if the graphical login screen is
used. I can get round generally by adding export commands to the .bashrc but run
into problems if trying to use not interactive shells because then the .bashrc
is not read (such as compiling from within xemacs - at least I think this is how
xemacs does its compilation).
If you want a login shell, you must specify it on the commandline of