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 > ps eww - check environment variables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-10, 19:01
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,810
ps eww - check environment variables

I sometimes need to check the env variables that were set at the time of db2start. I use "ps eww <PID of db2sysc>". This works fine on AIX. I also checked on Linux RHEL and it looks ok too.


From RHEL:

<-instv9->/etc==> ps -ef | grep db2sysc
instv9 24060 24059 0 16:33 pts/10 00:00:00 db2sysc 0
instv9 24114 23951 0 16:43 pts/10 00:00:00 grep db2sysc


<-instv9->/etc==> ps eww 24060
PID TTY STAT TIME COMMAND
24060 pts/10 S 0:00 db2sysc 0 HOME=/home/instv9 KRB5CCNAME=
FILE:/tmp/krb5cc_p23950 PWD=/home/instv9 DB2INSTANCE=instv9 DB2INSTDEF=instv9 DB2LPORT=0 DB2NODE=0
HOSTNAME=xxxxxxx.com LANG=en_US.UTF-8 USER=instv9 CLASSPATH=/home/instv9/sqllib/java/db2java.zip:
/home/instv9/sqllib/java/db2jcc.jar:/home/instv9/sqllib/java/sqlj.zip:/home/instv9/sqllib/function:/home/instv9/
.....




From SUSE Linux 10:

ps -ef | grep db2sysc
ldaptw 5408 5407 0 14:02 pts/0 00:00:00 db2sysc 0
ldaptw 5493 4403 0 14:04 pts/0 00:00:00 grep db2sysc


ps eww 5408
PID TTY STAT TIME COMMAND
5408 pts/0 S 0:00 db2sysc 0



Any idea why "ps eww" doesn't display env variables?
Reply With Quote
  #2 (permalink)  
Old 03-09-10, 20:17
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,448
ps implementation differ; check the man page for your particular installation.
Reply With Quote
  #3 (permalink)  
Old 03-09-10, 22:05
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,810
Thanks, Nick.

I think I now understand what is wrong. Cust must have issued this command when logged in as some other user id. From the info provided, it looked as if he was executing it using ldaptw.
Reply With Quote
  #4 (permalink)  
Old 03-10-10, 15:19
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,810
My cust tried ps eww on AIX and several Linux servers and it worked for all of them expect SUSE 10. He was logged in as the instance id. I also tried it on several Linux servers and it always displayed the env variables as long as I was doing it for my instance id.


My results:

$ whoami
dbguest2

$ cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (ppc)
VERSION = 10
PATCHLEVEL = 1


$ ps -ef | grep db2sysc
dbguest4 23205 23199 0 Mar02 ? 00:02:15 db2sysc
dbguest1 21904 21898 0 Mar09 pts/2 00:01:01 db2sysc
dbguest2 6493 6487 0 Mar09 pts/1 00:00:08 db2sysc
dbguest2 17696 2227 0 13:27 pts/1 00:00:00 grep db2sysc


$ ps eww 6493
PID TTY STAT TIME COMMAND
6493 pts/1 Sl 0:08 db2sysc HOME=/home/dbguest2 PWD=/etc DB2INSTANCE=dbguest2 HOSTNAME=xxxxxxx LANG=en_US.UTF-8 USER=dbguest2 CLASSPATH=.:/home/dbguest2/sqllib
....


$ ps eww 21904
PID TTY STAT TIME COMMAND
21904 pts/2 Sl 1:01 db2sysc



I thought I had it last night... Linux is too much fun.
Reply With Quote
  #5 (permalink)  
Old 03-10-10, 16:54
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,448
I didn't realize at first that you were trying to get the environment for a different process. That obviously is not allowed; you can only see the environment of your own processes, unless you are root.
Reply With Quote
  #6 (permalink)  
Old 03-10-10, 17:19
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,810
Customer was logged in as instance_id when he issued "ps eww <PID of db2sysc for that instance_id>". This works on all of their servers (AIX/Linux) except for SUSE 10. The only way I could reproduce this "behaviour" (no env info is displayed) is if I try to get the environment for a different user.


Anyway, there is another way of getting this info as described here:
http://yong321.freeshell.org/computer/ProcEnv.txt
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