I forgot to CC the list when I wrote these messages:<br><br>First message:<br><br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">I found something weird and I wonder if I should report a bug in the setup package or not.<br>
I've created /etc/profile.d/custom.sh, where I redefine PATH in order to have /usr/local after /usr for all users.<br>
But the files in /etc/profile.d/ are executed twice (in /etc/bashrc and
/etc/profile), and if a user sets PATH to PATH=$PATH:$HOME/bin, it won't
be taken into account.<br><br>Here is what happens when I start my KDE session + open Konsole:<br><br>/etc/profile is called by login<br>/etc/profile.d/custom.sh is called by /etc/profile<br>~/.bash_profile is called<br>
/etc/profile.d/custom.sh is called (by ~/.bashrc which calls /etc/bashrc)<br><br>As a result, the user will have the PATH I've defined in custom.sh, but he can't append something to it.<br></blockquote>
<br>Second message:<br><br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">I've added a test at the beginning of /etc/profile.d/custom.sh so that it is executed only once:<br>
<br>if shopt -q login_shell ; then<br> unset PATH<br><br>
if [ "$EUID" = "0" ]; then<br> PATH=/sbin:/bin:/usr/sbin:/<div>usr/bin:/usr/local/sbin:/usr/local/bin<br> else<br> PATH=/usr/bin:/bin:/usr/games:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin<br>
fi<br><br> export PATH<br>fi<br></div><br>That's way I don't need to change anything user side.<br>But it's a bit ugly and I don't think others distributions have this problem.<br></blockquote><br>