Operating System - HP-UX
1842317 Members
2804 Online
110188 Solutions
New Discussion

How to determine the environment of an already running process?

 
Geoff Wild
Honored Contributor

How to determine the environment of an already running process?

Can be done with berkley ps on Solaris - how to do it on HP-UX?

Can't be truss - as that needs to be launched prior to the command.

Thanks...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
2 REPLIES 2
Patrick Wallek
Honored Contributor

Re: How to determine the environment of an already running process?

Geoff,

No real answer for you, but I remembered, and found, a similar thread from a couple of months ago.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1116594

Patrick
A. Clay Stephenson
Acclaimed Contributor

Re: How to determine the environment of an already running process?

This is one of those "it depends" questions. It depends upon whether you have gdb on your box and whether the executable has been stripped (of symbols).

Execute "nm /xxx/yyy/myprog
If you see "no symbols" then Stop. Go Directly to jail. Do not pass Go. Do not collect $200.

If you are still executing at this point then determine the PID (e.g. 12345) of the process (myprog):

gdb /xxx/yyy/myprog 12345
set variable $q = (char **) environ
while *$q
print *$q++
end



If it ain't broke, I can fix that.