SuSE annoyance 1

Peter Buechler plug-discuss@lists.plug.phoenix.az.us
Sun, 21 Jul 2002 20:22:36 -0700


On Friday 19 July 2002 22:57, Trent Shipley wrote:

> Suspicion:
>
> Either I need to find the script that reads and executes /etc/profile and
> have it also execute /etc/profile.local OR have /etc/profile "execute"
> /etc/profile.local.

If you only want these in your own account, it should be run in ~/.profile or 
~/.bashrc. Only put it in /etc/profile.local if you want this to apply to all 
users in your machine. 

Also recall that your .profile is only run on a login shell, other shells do 
not read .profile, but read .bashrc instead.

It should not be necessary to reboot after you change /etc/profile.local. It 
is sufficient to start a new bash shell by typing

"bash --login"

after the prompt. Then see if your stuff ran correctly. Type "exit" to go back 
to the original shell, and to edit files if necessary.

I think that your .profile should run after /etc/profile, but just in case it 
is overriding it instead you could add a line to .profile to make sure that 
/etc/profile is run:

test -z "$PROFILEREAD" && . /etc/profile

PROFILEREAD is set to true in /etc/profile.

If you look through /etc/profile you should find a line that executes 
/etc/profile.local if it exists and has size greater than zero:

    test -s /etc/profile.local && . /etc/profile.local

Start by putting an echo line in profile.local to make sure that it is getting 
run:

echo "Yo! I am profile.local and I am running!"

Just for future reference, I highly recommend the book 
_Learning_the_bash_Shell_, by Cameron Newham & Bill Rosenblatt, from my 
favorite publisher, O'Reilly.

Let us know how things turn out,

-Pete-