Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39595 - KDE executes /etc/profile after .bash_profile
Summary: KDE executes /etc/profile after .bash_profile
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-27 12:51 UTC by Peter De Velder
Modified: 2005-01-16 09:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter De Velder 2004-01-27 12:51:51 UTC
The /etc/profile and thus the /etc/profile.env gets executed before (that's ok) and after (!!) the execution of a user's .bash_profile.  If the user made change to $PATH in his .bash_profile, these changes are lost as they are overwritten by the PATH in /etc/profile.env (generated by env-update)
This problem only occurs in a KDE session.  No problem in gnome or Xsession.

Reproducible: Always
Steps to Reproduce:
1. create a $HOME/.bash_profile containing  the line: PATH=$PATH:$HOME/bin
2. log on with this user in a KDE session
3. open an xterm and: echo $PATH
Actual Results:  
echo $PATH 
does not show the $HOME/bin 

Expected Results:  
KDE should not execute /etc/profile after the standard /bin/bash behaviour, excuting 
/etc/profile first and then .bash_profile 

Only for /bin/bash + kde session 
 
Workaround:  
put the line  PATH=$PATH:$HOME/bin 
in the .bashrc file an not in the .bash_profile
Comment 1 Paul de Vrieze (RETIRED) gentoo-dev 2004-01-27 14:00:23 UTC
Normally kde does not execute /etc/profile or .bash_profile at all. (please correct me if I'm wrong). /etc/profile is sourced before kdm, so there is some kind of path. However nowhere a login-shell is started so no .bash_profile is sourced (or /etc/profile). Kde itself has NOTHING to do with any bash (or any other shell) specific initialisation file. It only can start bash either normally or with --login, if you use konsole you can specify a flag to have it start a login shell.
Comment 2 Peter De Velder 2004-01-28 15:01:14 UTC
Ok, I investigated the problem more thoroughly.
The /usr/kde/3.1/bin/startkde shell script starts with #!/bin/sh --login
I changed it to #!/bin/sh and this fixes the problem.

Additional remarks:
1) the /etc/X11/xdm/Xsession executed before startkde already starts with 
#!/bin/bash --login
This is indeed needed.
2) /etc/X11/xdm/Xsession contains the following test:
if [ -n "`/etc/X11/chooser.sh`" ] then 
  exec "`/etc/X11/chooser.sh`"
It would be a good to change this to, as follows to avoid executing chooser twice :  
if [ -n "/etc/X11/chooser.sh" ] then 
  exec "`/etc/X11/chooser.sh`"
(Note: that the backquotes are not needed in the -n test)
Comment 3 Caleb Tennis (RETIRED) gentoo-dev 2004-05-20 05:09:16 UTC
See bug #23297 for information on why this is done.
Comment 4 Gregorio Guidi (RETIRED) gentoo-dev 2005-01-16 09:46:07 UTC
Things changed a lot since then, I think this should not be an issue anymore.
Reopen if I'm wrong.