Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A bit of Linux advice yet again??

2 views
Skip to first unread message

Howard J. Rogers

unread,
Feb 1, 2003, 2:36:00 AM2/1/03
to
OK, maybe I should post this in a Linux newsgroup, but...

Against all the odds, I've gotten 9.2 to run on Mandrake 9.0 (which, I have
to say, is the first Linux distro I've seen that's persuaded me there are
viable alternatives to Windows). I have a "DB9" instance/database and an
OEMREP instance/database. Log on as the Oracle user, and there's not a
problem.

But I want to log on as me. So, I create a .profile in my home directory
that sets all the usual variables, including path.

I reboot the machine, just because I'm a former Windows user and we're used
to that sort of thing. I log on as me. I open a terminal window, and type
'sqlplus', and I get the error 'command not found'.

I then type ". ./.profile", and the 'sqlplus' command works perfectly.

Now, I realise I only know the backend of batch files, but I was rather
under the impression that .profile would be invoked the moment I logged in.
So why isn't it? What am I doing wrong (try and keep the list modestly
short!).

Oh -one other thing. I know all about oratab, and I *do* get both my
instances starting automatically at reboot. But how does one automate the
intelligent agent and listener? oratab doesn't seem syntactically capable of
doing these, so I guess I must look elsewhere. Am I deep into shell
scripting at this point??

Forebearance for a Windows user, please. I am at least trying!!

Regards
HJR

Sybrand Bakker

unread,
Feb 1, 2003, 3:33:43 AM2/1/03
to
On Sat, 1 Feb 2003 18:36:00 +1100, "Howard J. Rogers"
<howard...@yahoo.com.au> wrote:

> Am I deep into shell
>scripting at this point??


Wha dayya call deep into shell scripting?
Adding
su - oracle -c "lsnrctl start"
(which will also start the agent)
to the correct rc*.d script shouldn't be too daunting, should it?

Regards


Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address

Eric Parker

unread,
Feb 1, 2003, 4:57:27 AM2/1/03
to
Howard
What shell are you using ?
.profile for bash, ksh, zsh and sh
.login for csh and tcsh
HTH
eric
"Howard J. Rogers" <howard...@yahoo.com.au> wrote in message
news:0FK_9.38003$jM5....@newsfeeds.bigpond.com...

Peter J. Holzer

unread,
Feb 1, 2003, 5:17:45 AM2/1/03
to
On 2003-02-01 07:36, Howard J. Rogers <howard...@yahoo.com.au> wrote:
> But I want to log on as me. So, I create a .profile in my home directory
> that sets all the usual variables, including path.
>
> I reboot the machine, just because I'm a former Windows user and we're used
> to that sort of thing. I log on as me. I open a terminal window, and type
> 'sqlplus', and I get the error 'command not found'.
>
> I then type ". ./.profile", and the 'sqlplus' command works perfectly.
>
> Now, I realise I only know the backend of batch files, but I was rather
> under the impression that .profile would be invoked the moment I logged in.
> So why isn't it? What am I doing wrong (try and keep the list modestly
> short!).

I am assuming that you are using the bash - some other shells
(personally I use and recommend the zsh) use other startup files.

The .profile is only read by a "login shell", i.e. a shell which is
started with the first character of the command name set to "-". The
login program invokes the shell this way, but terminal emulators like
xterm generally do not (there is an option for this, though). So you may
not have the same environment in the GUI as on the console or when you
login remotely.

There are two ways to fix this:

1) Invoke xterm (or kterm, or gnome-terminal, or whatever Mandrake uses)
with the option to start a login shell.

2) Source the profile in your .Xsession file (Newer versions of Redhat use
a login shell to execute the session file, so there this will happen
automatically, which is "The Right Thing", IMHO, but it seems that
Mandrake doesn't do this).

How to do these things depends on what display manager and desktop
environment you use and probably also on some distribution-specific
scripts.

You could also set the environment variables in the .bashrc instead of
the .profile. This is read by every interactive shell, not just login
shells.

Oh, and you could check whether you have a .bash_profile. If you have,
the bash will read that and ignore your .profile.

> Oh -one other thing. I know all about oratab, and I *do* get both my
> instances starting automatically at reboot. But how does one automate the
> intelligent agent and listener?

The installer creates a startup and stop script (called "oracle") in the
"local directory" you specify at some point during installation (at
least with Oracle 8.x, haven't installed 9.x yet). You can just add the
commands to start and stop the listener to that (Although I was quite
sure that this script normally does start both the database and the
listener, so I find it quite odd that you get running instances but no
listener).

hp

--
_ | Peter J. Holzer | To a database person,
|_|_) | Sysadmin WSR | every nail looks like a thumb.
| | | h...@hjp.at |
__/ | http://www.hjp.at/ | -- Jamie Zawinski

Noons

unread,
Feb 1, 2003, 6:39:33 AM2/1/03
to
"Howard J. Rogers" <howard...@yahoo.com.au> wrote in
news:0FK_9.38003$jM5....@newsfeeds.bigpond.com and I quote:


> Against all the odds, I've gotten 9.2 to run on Mandrake 9.0 (which, I
> have to say, is the first Linux distro I've seen that's persuaded me
> there are viable alternatives to Windows). I have a "DB9"

Hehehe! Not bad at all, eh? And dirt cheap too!
Mind you, I've found a few minor probs. Still prefer Suse 8, but
Mandrake is sooooo cool!


>
> But I want to log on as me. So, I create a .profile in my home directory
> that sets all the usual variables, including path.
>


Hmmm, I think you should look at using oraenv?
That is probably what the Oracle user does. Unless things
have majorly changed in 9ir2.

Warning: boring stuff follows, ignore if you're aware of it.
Works like this, assuming any shell except "C":

1 - a script called "oraenv" exists in /usr/local/bin.

2- This path (/usr/local/bin) should be part of your PATH
variable, set by "profile".

3- oraenv reads the /etc/oratab file looking for ORACLE_HOME and SID values.
and a few other things I won't go into now.

4- If you set ORACLE_SID in your profile, then export it, then
set ORAENV_ASK to NO, then export it, then call oraenv using
exactly this syntax:
. oraenv<CR>
(note the space between the dot and the word!)
then that should set you up to that SID automatically.

One of the good things of doing it thusly is that you don't
have to worry about removing stuff from your PATH and setting
it to others when changing SIDs: oraenv does all that magic for you.


> I reboot the machine, just because I'm a former Windows user and we're
> used to that sort of thing. I log on as me. I open a terminal window,
> and type 'sqlplus', and I get the error 'command not found'.
>
> I then type ". ./.profile", and the 'sqlplus' command works perfectly.

That is indeed strange. What have you got defined as your home
directory in /etc/passwd? What is the contents of /etc/profile
(global profile file run before yours)?

Do an "echo $PATH" just after login and after running your profile
and see if any diffs.
Check out if /usr/local/bin is part of your PATH right at the top
of your ".profile" script. And also check out if this path
is accessible to you as a user (r-x in protection for world).

Make sure that ORACLE_HOME and all the stuff under it is
accessible to world (r-x), otherwise there may be problems.

>
> Now, I realise I only know the backend of batch files, but I was rather
> under the impression that .profile would be invoked the moment I logged
> in. So why isn't it? What am I doing wrong (try and keep the list
> modestly short!).
>

Only if your login shell doesn't know about "profile". Which
would be the case if it is the "C" shell. Or if your /etc/passwd
file is seriously waco for your login id.


> Oh -one other thing. I know all about oratab, and I *do* get both my
> instances starting automatically at reboot. But how does one automate
> the intelligent agent and listener? oratab doesn't seem syntactically
> capable of doing these, so I guess I must look elsewhere. Am I deep into
> shell scripting at this point??


Yes, you are. The equivalent of Windows "Startup" folder in
Unix is a reasonably complex thing called "rc" scripts and init()
process. Scripts live in "/etc/rcnn" where "nn" may start at 0.
They are directories that contain scripts for starting up groups of
software depending on which run level you're going to.

Unix has this quaint concept of run levels. 5 is multi-user,
1 is single user, a lot of things in between. Each run level
corresponds to one of the numbers in the rc(nn) directories.
Each directory will contain the startup files for what you want
to run in those levels. You put the corresponding startup
scripts for Oracle stuff in those.

Those scripts you write yourself, or you stick to standards
and use the "dbstart" and "dbshut" stuff from Oracle.
For starting the listener, you add it to the top of dbstart
for example, with something like "lsnrctl start" right at
the top of that script.

Read all about it by looking at the "init()" man pages, that's
the process that controls startup and run levels in Unix.

Shutdown is also handled by same mechanism, BTW.


HTH. Any probs, ping me offline.
--
Cheers
Nuno Souto
nso...@optusnet.com.au.nospam

Howard J. Rogers

unread,
Feb 1, 2003, 8:14:40 AM2/1/03
to

"Noons" <nso...@optusnet.com.au.nospam> wrote in message
[lots of good stuff snipped, which I shall return to in the morning]

>
> > Oh -one other thing. I know all about oratab, and I *do* get both my
> > instances starting automatically at reboot. But how does one automate
> > the intelligent agent and listener? oratab doesn't seem syntactically
> > capable of doing these, so I guess I must look elsewhere. Am I deep into
> > shell scripting at this point??
>
> Yes, you are. The equivalent of Windows "Startup" folder in
> Unix is a reasonably complex thing called "rc" scripts and init()
> process.

Oh God. I feel run levels coming on.


>Scripts live in "/etc/rcnn" where "nn" may start at 0.
> They are directories that contain scripts for starting up groups of
> software depending on which run level you're going to.
>
> Unix has this quaint concept of run levels.

Oh dear.

>5 is multi-user,
> 1 is single user, a lot of things in between. Each run level
> corresponds to one of the numbers in the rc(nn) directories.
> Each directory will contain the startup files for what you want
> to run in those levels. You put the corresponding startup
> scripts for Oracle stuff in those.
>


Isn't there an 'OK' button somewhere???


> Those scripts you write yourself, or you stick to standards
> and use the "dbstart" and "dbshut" stuff from Oracle.
> For starting the listener, you add it to the top of dbstart
> for example, with something like "lsnrctl start" right at
> the top of that script.
>
> Read all about it by looking at the "init()" man pages,

Have you *read* those man pages?

Personally, I think they were all written by French people looking for
revenge for Agincourt, and deciding that mangling the English language was
the best way forward.

>that's
> the process that controls startup and run levels in Unix.
>
> Shutdown is also handled by same mechanism, BTW.

It's now gone midnight. I will have to review your post in some greater
detail sometime after midday tomorrow. But something tells me that you've
answered my question in spades anyway, so thanks a million.

God, I like Windows.

Regards
HJR


Howard J. Rogers

unread,
Feb 1, 2003, 8:07:50 AM2/1/03
to

"Sybrand Bakker" <gooid...@nospam.demon.nl> wrote in message
news:ag1n3vs56nejqr4su...@4ax.com...

> On Sat, 1 Feb 2003 18:36:00 +1100, "Howard J. Rogers"
> <howard...@yahoo.com.au> wrote:
>
> > Am I deep into shell
> >scripting at this point??
>
>
> Wha dayya call deep into shell scripting?
> Adding
> su - oracle -c "lsnrctl start"
> (which will also start the agent)
> to the correct rc*.d script shouldn't be too daunting, should it?
>

It would be compared to selecting 'automatic' in the services applett. But I
get the hint.

Regards
HJR


Howard J. Rogers

unread,
Feb 1, 2003, 8:08:41 AM2/1/03
to

"Eric Parker" <Eric_Parke...@btopenworld.com> wrote in message
news:b1g5m7$alm$1...@helle.btinternet.com...

> Howard
> What shell are you using ?
> .profile for bash, ksh, zsh and sh


I'm pretty certain its bash. Which is why I was slightly gobsmacked that I
had to invoke .profile manually each time

Regards
HJR

zeb

unread,
Feb 1, 2003, 10:06:24 AM2/1/03
to
If you have a .bash_profile, the .profile is'nt read
put your configuration in the .bash_profile

"Howard J. Rogers" <howard...@yahoo.com.au> a écrit dans le message de
news: 0FK_9.38003$jM5....@newsfeeds.bigpond.com...

Frank

unread,
Feb 1, 2003, 11:10:47 AM2/1/03
to
Howard J. Rogers wrote:
> "Eric Parker" <Eric_Parke...@btopenworld.com> wrote in message
> news:b1g5m7$alm$1...@helle.btinternet.com...
>
>>Howard
>>What shell are you using ?
>>.profile for bash, ksh, zsh and sh
>
>
>
> I'm pretty certain its bash. Which is why I was slightly gobsmacked that I
> had to invoke .profile manually each time
>
> Regards
> HJR
>
>
<snip>!

That whould have to be .bash_profile?

Frank

Howard J. Rogers

unread,
Feb 1, 2003, 2:45:36 PM2/1/03
to
Thanks Frank and zeb: .bash_profile did it, beautifully.

I was following my old instructions for SuSe 7.1, where .profile worked, but
I now realise the error of my ways in hoping that the same operating system
would work the same way, regardless of the distro!

Appreciate your help very much.

Regards
HJR


"zeb" <thierry....@wanadoo.fr> wrote in message
news:3e3be271$0$232$626a...@news.free.fr...

Noons

unread,
Feb 1, 2003, 10:29:37 PM2/1/03
to
"Howard J. Rogers" <howard...@yahoo.com.au> wrote in
news:BCP_9.38244$jM5....@newsfeeds.bigpond.com and I quote:

>
> Isn't there an 'OK' button somewhere???


LOL! Well if you use tcs, you can make yourself
as many buttons as you want. "OK" or otherwise...

>
> Have you *read* those man pages?
>
> Personally, I think they were all written by French people looking for
> revenge for Agincourt, and deciding that mangling the English language was
> the best way forward.


Hehehe! *Had* to read all about it a few years ago,
when I was doing Oracle + Unix admin at Rothmans.
Haven't looked back into it since then, but it still should
be very much the same: there isn't that much difference
in Linux. However, as always: don't believe me blank.
Please do your own reading, I may well be wrong in a detail
here and there!

>
> God, I like Windows.
>

Yeah, for this sort of stuff it's not half bad.
Mind you, I'd hate to have to sequence startup
of many different inter-related processes in Windows.
This stuff in Unix is slightly complex, but it
is very, very flexible.

Noons

unread,
Feb 1, 2003, 10:37:29 PM2/1/03
to
"Howard J. Rogers" <howard...@yahoo.com.au> wrote in
news:%kV_9.38366$jM5....@newsfeeds.bigpond.com and I quote:


> I was following my old instructions for SuSe 7.1, where .profile worked,
> but I now realise the error of my ways in hoping that the same operating
> system would work the same way, regardless of the distro!
>


One thing: bash is very specific to Linux. And to some distributions.
If you want to make sure your code will always behave the same way,
then stick to Unix-standard shells. That means bourne shell and Korn shell.
Both of these use .profile and will work exactly the same across
every single Unix flavour you can imagine.


With all respect to Linux users, bash is not yet a standard in the
Unix world. Hence the probs you're having. It's much better if you
standardise all your scripts in a shell that can be found everywhere.
The one I found to be universal is the Korn shell, or "ksh" for short.
Nowadays even the ubiquitous bourne-shell has been stuffed up,
namely by HP with their "posix shell"! Ksh is pretty much the same
everywhere and always works the same way. Which means: "predictable".


Having said that, if you have a .profile and a .bash_profile,
run the .profile from inside the other one, using the ". "
convention and you should be right. You can always find a way
of keeping things the same in the Unix world! ;)

Tim X

unread,
Feb 2, 2003, 12:15:29 AM2/2/03
to
>>>>> "Howard" == Howard J Rogers <howard...@yahoo.com.au> writes:

Howard> OK, maybe I should post this in a Linux newsgroup, but...
Howard> Against all the odds, I've gotten 9.2 to run on Mandrake 9.0
Howard> (which, I have to say, is the first Linux distro I've seen
Howard> that's persuaded me there are viable alternatives to
Howard> Windows). I have a "DB9" instance/database and an OEMREP
Howard> instance/database. Log on as the Oracle user, and there's not
Howard> a problem.

Howard> But I want to log on as me. So, I create a .profile in my
Howard> home directory that sets all the usual variables, including
Howard> path.

Howard> I reboot the machine, just because I'm a former Windows user
Howard> and we're used to that sort of thing. I log on as me. I open
Howard> a terminal window, and type 'sqlplus', and I get the error
Howard> 'command not found'.

Howard> I then type ". ./.profile", and the 'sqlplus' command works
Howard> perfectly.

Howard> Now, I realise I only know the backend of batch files, but I
Howard> was rather under the impression that .profile would be
Howard> invoked the moment I logged in. So why isn't it? What am I
Howard> doing wrong (try and keep the list modestly short!).

Howard> Oh -one other thing. I know all about oratab, and I *do* get
Howard> both my instances starting automatically at reboot. But how
Howard> does one automate the intelligent agent and listener? oratab
Howard> doesn't seem syntactically capable of doing these, so I guess
Howard> I must look elsewhere. Am I deep into shell scripting at this
Howard> point??

Howard> Forebearance for a Windows user, please. I am at least
Howard> trying!!

Howard> Regards HJR

Howard,

Good to hear your comming over to the dark side :-).

I bet your logging in using X windows?

I suspect what is happening is your X windows has been configured so
that when you open an xtern it opens it as a non-login shell. The
.profile (or .bash_profile - assuming you are using bash) is only
sourced for login shells.

There are two solutions for this.

1. Most terminal emulators like xterm have a swith which you can pass
to it that will cause the shell it spawns to be a login shell - its
probably something like -ln.

2. What I like to do is edit the .xsession file (or whatever file on
Mandrake sets up your X environment and add a swith to the shell
line at the top to make it run as a login shell. I think for bash
this is --login, so the top of your .xsession (or whatever it is
called) will look like

#!/bin/sh --login

or

#!/bin/bash --login

I like the second approach because all your environment variables ar
set in the parent shell of your X session, so all programs spawned
from that shell, including other shells will have all your .profiel
environment settings.

Tim

P.S. Once we hae you converted to linux, we will have to convince you
of the wonders of emacs and sql-mode!


--
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you
really need to send mail, you should be able to work it out!

Tim X

unread,
Feb 2, 2003, 12:23:25 AM2/2/03
to
>>>>> "Frank" == Frank <fvanb...@netscape.net> writes:

Frank> Howard J. Rogers wrote:
>> "Eric Parker" <Eric_Parke...@btopenworld.com> wrote in
>> message news:b1g5m7$alm$1...@helle.btinternet.com...
>>

>>> Howard What shell are you using ? .profile for bash, ksh, zsh
>>> and sh
>> I'm pretty certain its bash. Which is why I was slightly
>> gobsmacked that I

>> had to invoke .profile manually each time Regards

>> HJR
>>

Frank> <snip>!

Frank> That whould have to be .bash_profile?

Frank> Frank

Actually, bash will look for a number of different files in a certain
order and stops with the first one it finds. I think the order is
something like -

/etc/profile
~/.bash_profile
~/.bash_login
~/.profile

BUT it only looks for these files iff it is a login shell. Under X,
unless your .xsession has the --login option set, all terminals
(xterms et. al.) you open are opened as just a sub-shell of your X
session and therefore not as a login shell (as you are already logged
in).

Tim

Tim X

unread,
Feb 2, 2003, 12:39:18 AM2/2/03
to
>>>>> "Noons" == Noons <nso...@optusnet.com.au.nospam> writes:

Noons> "Howard J. Rogers" <howard...@yahoo.com.au> wrote in
Noons> news:%kV_9.38366$jM5....@newsfeeds.bigpond.com and I quote:


>> I was following my old instructions for SuSe 7.1, where .profile
>> worked, but I now realise the error of my ways in hoping that the
>> same operating system would work the same way, regardless of the
>> distro!
>>


Noons> One thing: bash is very specific to Linux. And to some
Noons> distributions. If you want to make sure your code will always
Noons> behave the same way, then stick to Unix-standard shells. That
Noons> means bourne shell and Korn shell. Both of these use .profile
Noons> and will work exactly the same across every single Unix
Noons> flavour you can imagine.

Actually, bash WILL read .profile - it sources profiles in a specific
order and stops with the first one it finds. I think .profile is the
last one it looks for, wtih .bash_profile, .bash_login searched for
first.

With respect to compatibility with Bourne shell, I find it is very
compatible as long as you don't use bash specific commands in your
.profile - this is very easy to do as the non-compatible aspects of
bash are mainly related to scripting features which you rarely see in
a .profile.

If you want to increase compatability with Bourne, you can always
invoke bash as sh i.e. #!/bin/sh. This is what I tend to do with many
shell scripts which I want to run on other flavors of unix.

In an earlier post in this thread, there was also some mention of the
Oracle orenv/corenv scripts - these are certainly the way to go as it
makes handling different SIDS a lot easier (and even different
versions of the db). However, be certain to use the script which
matches with your shell - there is both orenv (for Bourne shells) and
corenv (For csh shells). One thing I've never understood is why Oracle
makes such extensive use of csh and even tcsh for shell scripts - even
13 years ago when I first started unix, the rule of thumb was to only
ever use csh/tcsh as an interactive shell and stick to sh for all
scripts (or perhaps ksh).

Noons

unread,
Feb 2, 2003, 5:00:40 AM2/2/03
to
Tim X <ti...@spamto.devnul.com> wrote in
news:87smv74...@tiger.rapttech.com.au and I quote:

> corenv (For csh shells). One thing I've never understood is why Oracle
> makes such extensive use of csh and even tcsh for shell scripts - even
> 13 years ago when I first started unix, the rule of thumb was to only
> ever use csh/tcsh as an interactive shell and stick to sh for all
> scripts (or perhaps ksh).


Yes, very much the same here. Never understood why one would
bother with the csh. Even for interactive: most of the stuff
it did over and above sh is readily available in ksh. And
ksh is vanilla to make compatible with any bourne scripts.

I guess it must have been one of those old "Berkeley vs AT&T"
fights: csh seemed to be the thing for Berkeley people.

Frank

unread,
Feb 2, 2003, 10:47:19 AM2/2/03
to

Hear, hear! Do you hear that, Oracle?
Currenlty trying to convince an old dual celeron machine to install
9iAS Rel.10221. The install scripts have sh, csh and ksh spelled
all over the place - and ksh isn't standard on modern Linux distro's
anymore...
Gave up changing them over and again, and installed the Korn shell...

Oh well, just been through the 5th 'delete user portal30 cascade'...

No, I'm not going to install Rel2 - I do not have 2G memory in this
box, and never will.

Frank

Noons

unread,
Feb 3, 2003, 6:51:20 AM2/3/03
to
Frank <fvanb...@netscape.net> wrote in
news:3E3D3D87...@netscape.net and I quote:

>
> No, I'm not going to install Rel2 - I do not have 2G memory in this
> box, and never will.

Freakin annoying, isn't it?

Norman Dunbar

unread,
Feb 3, 2003, 8:17:56 AM2/3/03
to
Hi Tim,

I'm not 100% sure, but isn't /etc/profile always run as it sets up stuff
you (the sys admin) want setting up for all users, and then it looks for
the others. It certainly does on my HP servers - /etc/profile then
$HOME/.profile where $HOME is appropriate to the user logging in -
obviously !

Cheers,
Norman.

-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman...@LFS.co.uk
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------

Alex Filonov

unread,
Feb 3, 2003, 11:56:52 AM2/3/03
to
"Howard J. Rogers" <howard...@yahoo.com.au> wrote in message news:<0FK_9.38003$jM5....@newsfeeds.bigpond.com>...

> OK, maybe I should post this in a Linux newsgroup, but...
>
> Against all the odds, I've gotten 9.2 to run on Mandrake 9.0 (which, I have
> to say, is the first Linux distro I've seen that's persuaded me there are
> viable alternatives to Windows). I have a "DB9" instance/database and an
> OEMREP instance/database. Log on as the Oracle user, and there's not a
> problem.
>
> But I want to log on as me. So, I create a .profile in my home directory
> that sets all the usual variables, including path.
>
> I reboot the machine, just because I'm a former Windows user and we're used
> to that sort of thing. I log on as me. I open a terminal window, and type
> 'sqlplus', and I get the error 'command not found'.
>
> I then type ". ./.profile", and the 'sqlplus' command works perfectly.
>
> Now, I realise I only know the backend of batch files, but I was rather
> under the impression that .profile would be invoked the moment I logged in.
> So why isn't it? What am I doing wrong (try and keep the list modestly
> short!).
>

Howard,

It's a tricky part with linux, actually, with bash. .profile is not
the
primary file executed on logon. There are several files you need to
check.
Here's the cut from bash manual:

An interactive shell is one whose standard input and output are both
connected to terminals (as determined by isatty(3)), or one started
with the -i flag. PS1 is set and $- includes i if bash is interactive,
allowing a way to test this state from a shell script or a startup
file.

Login shells:

On login:

If /etc/profile exists, source it.
If ~/.bash_profile exists, source it,
else if ~/.bash_login exists, source it,
else if ~/.profile exists, source it.
On logout: If ~/.bash_logout exists, source it.

Non-login interactive shells:

On startup:

If ~/.bashrc exists, source it.

Non-interactive shells:

On startup

If the environment variable ENV is non-null,
expand it and source the file it names.

In short, check your .bash_login and .bash_profile files. If they
exist,
check if they call .profile.

HTH

Frank

unread,
Feb 3, 2003, 4:20:57 PM2/3/03
to
Noons wrote:
> Frank <fvanb...@netscape.net> wrote in
> news:3E3D3D87...@netscape.net and I quote:
>
>
>>No, I'm not going to install Rel2 - I do not have 2G memory in this
>>box, and never will.
>
>
> Freakin annoying, isn't it?
>

Yup - maybe in a new box (oh dear, don't let the wife read
this!) in the near future.

Got it to work, finally, now need to trim down portal. Have some
9 httpd deamons and 12 or 15 jre processes right after startup...

Tim X

unread,
Feb 3, 2003, 4:42:21 PM2/3/03
to
>>>>> "Norman" == Norman Dunbar <Norman...@lfs.co.uk> writes:

Norman> Hi Tim, I'm not 100% sure, but isn't /etc/profile always run
Norman> as it sets up stuff you (the sys admin) want setting up for
Norman> all users, and then it looks for the others. It certainly
Norman> does on my HP servers - /etc/profile then $HOME/.profile
Norman> where $HOME is appropriate to the user logging in - obviously
Norman> !


Norman> /etc/profile ~/.bash_profile ~/.bash_login ~/.profile

Norman> BUT it only looks for these files iff it is a login
Norman> shell. Under X, unless your .xsession has the --login option
Norman> set, all terminals (xterms et. al.) you open are opened as
Norman> just a sub-shell of your X session and therefore not as a
Norman> login shell (as you are already logged in).

/etc/profile is always run for login shells - I don't think it is run
for non-login shells, but all non-login shells are usually a sub-shell
of a login shell somewhere in the chain. However, I would have to
check the bash man page to be sure on that. I am certain the
$HOME/.bash_profile et. al. are only checked for login shells and it
stops after the first match it finds e.g. if you have both
.bash_profile and .profile in your home dir, the .profile will never
get sourced because it will stop after reading .bash_profile.

Personally, I make a symlink from .bash_profile to .profile and then
forget about which one it is meant to be :-)

Joel Garry

unread,
Feb 3, 2003, 7:57:16 PM2/3/03
to
Norman Dunbar <Norman...@lfs.co.uk> wrote in message news:<E2F6A70FE45242488C86...@lnewton.leeds.lfs.co.uk>...

> Hi Tim,
>
> I'm not 100% sure, but isn't /etc/profile always run as it sets up stuff
> you (the sys admin) want setting up for all users, and then it looks for
> the others. It certainly does on my HP servers - /etc/profile then
> $HOME/.profile where $HOME is appropriate to the user logging in -
> obviously !

Be wary of advice given based on HP servers - hp/ux is by itself in
the unix/oracle world for how it searches /etc.

Of course, all unix are more-or-less converging, but there are still
gotchas between them. Linux has an advantage in being a workalike and
not quite as subject to SYS-V/BSD idiosyncracies.

jg
--
@home is bogus.
I once worked on Duplix, which had both SYS-V and BSD "universes!"

Joel Garry

unread,
Feb 3, 2003, 8:05:40 PM2/3/03
to
Noons <nso...@optusnet.com.au.nospam> wrote in message news:<Xns9316D357AE0...@210.49.20.254>...

I got the impression it was more globally due to the use of C
programming in universities. Then the kiddies would get out in the
world and do what they knew from class. I saw one big-time product
with multiple levels of csh calling sh calling csh caling sh,
including the ocassional script labelled .csh with a #!/bin/sh at the
start...

ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/comp/answers/unix-faq/shell/csh-whynot

jg
--
@home is bogus.

Or was it the other way 'round?

Norman Dunbar

unread,
Feb 4, 2003, 5:16:58 AM2/4/03
to
Morning Joel,

good advice - which is why I mentioned that I wasn't 100% sure. HP tend
to muck about with standard things in a similar way to Microsoft :o)

Cheers,
Norman.

-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman...@LFS.co.uk
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------


-----Original Message-----
From: joel-...@home.com (Joel Garry) [mailto:joel-...@home.com]
Posted At: Tuesday, February 04, 2003 12:57 AM
Posted To: server
Conversation: A bit of Linux advice yet again??
Subject: Re: A bit of Linux advice yet again??

Noons

unread,
Feb 4, 2003, 7:22:28 AM2/4/03
to
Frank <fvanb...@netscape.net> wrote in news:3E3EDD39...@netscape.net
and I quote:

>
> Yup - maybe in a new box (oh dear, don't let the wife read
> this!) in the near future.

Send the box to work first. DAMHIKT...

0 new messages