Operating System - OpenVMS
1752630 Members
5988 Online
108788 Solutions
New Discussion юеВ

Re: Finding out what image is being executed by another process

 
SOLVED
Go to solution
Jimson_1
Frequent Advisor

Finding out what image is being executed by another process

Hi,

From within a DCL script I need to see what image is being executed on another one of my processes.

Can't seem to do it with F$GETJPI or SHOW PROC/CO

Any ideas?

James
13 REPLIES 13
Craig A Berry
Honored Contributor

Re: Finding out what image is being executed by another process

Yes, you can do with with F$GETJPI, for example:

$ write sys$output f$getjpi("1b1", "IMAGNAME")
DSA0:[SYS0.SYSCOMMON.APACHE.][000000]APACHE$HTTPD.EXE;1

Craig A Berry
Honored Contributor

Re: Finding out what image is being executed by another process

Yes, you can do it with F$GETJPI, for example:

$ write sys$output f$getjpi("1b1", "IMAGNAME")
DSA0:[SYS0.SYSCOMMON.APACHE.][000000]APACHE$HTTPD.EXE;1

labadie_1
Honored Contributor

Re: Finding out what image is being executed by another process

Hello

You have a command file in sys$examples that does it, just do

@ sys$examples:working_set.com

Comment the line
$ imagename = F$PARSE (imagename,,,"NAME") ! separate name from filespec

if you want the full image name (disk:image.exe;

Jimson_1
Frequent Advisor

Re: Finding out what image is being executed by another process

Cheers guys.

I've tried using F$GETJPI(pid,"IMAGENAME") but for some reason it returns a null string.

$ write sys$output f$getjp("370020F6","imagname")

$
Jimson_1
Frequent Advisor

Re: Finding out what image is being executed by another process

Sorry I should clarify this a little.

I'm trying to run the correct version of GAWK on one of my sessions, but it keeps picking up the wrong version.

I've checked symbol definitions and the DCL$PATH logical but can't see anythinhg wrong.

On the session running GAWK I have the following output (Control-T'd it to get the process name and then obtained the PID)

P_CC(H1-ACT)$ gawk
_data file(s):
HFCP01::_TNA15: 16:02:32 (DCL) CPU=00:21:02.77 PF=314530 IO=5301382 MEM=327
_data file(s):
Ian Miller.
Honored Contributor

Re: Finding out what image is being executed by another process

Do you have the right privs?

____________________
Purely Personal Opinion
Jimson_1
Frequent Advisor

Re: Finding out what image is being executed by another process

Yes I do have the right privileges.

For example, if I stop the GAWK image, and issue the command DUMP /PAGE A.DAT instead, I get:

$ write sys$output f$getjpi("370020F6","imagname")
DSA13:[SYS1.SYSCOMMON.][SYSEXE]DUMP.EXE;1
$
labadie_1
Honored Contributor

Re: Finding out what image is being executed by another process

a basic
$ show proc/cont/id=pid_of_your_process

shows what image ?
Phillip Thayer
Esteemed Contributor

Re: Finding out what image is being executed by another process

If I'm not mistaken you will get a blank imagename if it is in DCL. Best way I would say to do this is to run your GAWK and on another terminal use the SHOW PROCESS/CONTIN/ID=pid

Once there you will see the image name changing at the bottom as it runs different programs. Then you should be able to determine the version of GAWK that is running.

If your having problems with the wrong version of GAWK running from what you expect, then I would say you have an older version of GAWK installed as an installed image. Do the following:

MC INSTALL
/LIST

Look for a listing for GAWK and see what version it is. If it's wrong then install the proper onw with a replace command in the install utility.

Phil
Once it's in production it's all bugs after that.