On Mon, Mar 11, 2002 at 02:05:42PM -0800, Ben Reser wrote:
> Okay lots of people have reported the problems with Eterm and TMOUT
> complaining. For some reason which I haven't tried to figure out bash
> run under Eterm is sourcing /etc/bashrc twice.
>
> bashrc sources /etc/profile.d/msec.sh
> which sources /etc/sysconfig/msec
>
> The last contains TMOUT=0
> msec.sh then sets it readonly.
>
> Wrapping the TMOUT=0 in /etc/sysconfig/msec like so fixes it but
> probably not an ideal way to fix the problem:
> if ! readonly | grep -q TMOUT;then
> TMOUT=0
> fi
Okay more info.
All of Eterm's shells default to running a login shell.
Courtesy of the following line in the MAIN file of the themes:
login_shell true
Changing it to false gets rid of the error.
However, this really isn't an Eterm issue. This occurs with any login
shell. Running:
xterm -ls
konsole -ls
aterm -ls
gnome-terminal --login
rxvt -ls
Will all make this error occur.
Here's why:
When bash is invoked as a login shell it first sources /etc/profile,
which sources all the files in /etc/profile.d and runs msec.sh. Then it
looks for ~/.bash_profile which sources ~/.bashrc which sources
/etc/bashrc which also sources everything in /etc/profile.d again
running msec.sh. And then it looks for ~/.bash_login and ~/.profile
neither of which Mandrake installs in the default users.
So the question is how do you get both types of bash invocations to run
the files in /etc/profile.d without running them twice.
Well there is already a test in there for $SHLVL however, $SHLVL has
nothing to do with login shells. The shell does however set a special
variable $loginsh when it is a login shell. Testing this will fix the
problem.
I've attached a patch to /etc/bashrc that fixes the problem.
--
Ben Reser <[EMAIL PROTECTED]>
http://ben.reser.org
What difference does it make to the dead, the orphans, and the homeless,
whether the mad destruction is wrought under the name of totalitarianism
or the holy name of liberty and democracy? - Ghandi
*** /etc/bashrc~ Mon Mar 11 17:01:17 2002
--- /etc/bashrc Mon Mar 11 17:01:33 2002
***************
*** 22,28 ****
esac
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
! if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -x $i ]; then
. $i
--- 22,28 ----
esac
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
! if [ -n "$loginsh" ]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -x $i ]; then
. $i