If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > aix db2profile not running problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-21-08, 13:19
chinatrain99 chinatrain99 is offline
Registered User
 
Join Date: Sep 2003
Posts: 73
aix db2profile not running problem

I'm connecting via Reflection X using OPENSSH. When I log in, the db2profile doesn't get ran automatically. I have to manually execute the db2profile after logging on. What has to be done to auto run the db2 profile when I log in with OPENSSH. To get it to work on a server we telnet into, we added these 2 lines to the .profile

ENV=.krcsh
export ENV

then we created a .krcsh file that executes the db2 profile. Don't ask me why this was done (before me and they're gone), but it worked. Either we're missing a piece that was done before, or something extra has to be done for OPENSSH. Any help would be appreciated.
Reply With Quote
  #2 (permalink)  
Old 08-21-08, 14:45
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Why don't you just add the db2profile invokation into ~/.profile?
Reply With Quote
  #3 (permalink)  
Old 08-21-08, 14:58
chinatrain99 chinatrain99 is offline
Registered User
 
Join Date: Sep 2003
Posts: 73
I did. here's what I've been testing...

I added an echo statements to .profile

$ cat .profile
echo "running .profile...."

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.

export PATH

if [ -s "$MAIL" ] # This is at Shell startup. In normal
then echo "$MAILMSG" # operation, the Shell checks
fi # periodically.

# The following three lines have been added by UDB DB2.
. /home/db2inst1/sqllib/db2profile
ENV=.krcsh
export ENV

I added an echo statement to db2profile

DB2INSTANCE=db2inst1
export DB2INSTANCE
INSTHOME=/home/db2inst1
echo "running db2profile...."

If I log in as dasusr1 and switch to db2inst1:

$ whoami
dasusr1
$ su - db2inst1
db2inst1's Password:
running .profile....
running db2profile....
running db2profile....
$

This ran the db2 profile twice. I believe we're running the new environment variable .krcsh which also executes db2profile.

If we log on as db2inst1, we get nothing…

If I execute the .profile manually, I get:

$ . /.profile
TERM=vt320
running db2profile....
des084iimp1: /home/db2inst1#
(notice I never got the "running .profile" message??)

If I execute the db2profile manually, I get my prompt.

des084iimp1: /home/db2inst1/sqllib#. /home/db2inst1/sqllib/db2profile
running db2profile....
des084iimp1: /home/db2inst1/sqllib#


Seems like i'm not running .profile when I log on...
Reply With Quote
  #4 (permalink)  
Old 08-21-08, 17:18
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Have you added the sourcing of db2profile also in /.profile? This file resides in the root directory of the file system - but it seems like a very bad idea doing that. So why am I asking this? This is the file you are sourcing:
Quote:
$ . /.profile
My guess is that you have to make sure you are using the correct files here...
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 08-22-08, 10:21
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
which shell is being used for this userid : echo $SHELL
.profile is for ksh
.bash_profile for bash ....
and other
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #6 (permalink)  
Old 08-24-08, 15:38
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Bash also reads .profile if it is started as login shell.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #7 (permalink)  
Old 08-26-08, 15:12
chinatrain99 chinatrain99 is offline
Registered User
 
Join Date: Sep 2003
Posts: 73
$ echo $SHELL
/usr/bin/ksh

and .profile is invoking db2profile
# The following three lines have been added by UDB DB2.
. /home/db2inst1/sqllib/db2profile
ENV=.krcsh
export ENV
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On