[Info-vax] Check if a process will auto-terminate
Joseph Huber
joseph.huber at NIRWANA.web.de
Tue Apr 28 13:39:52 EDT 2009
Stephen Davies schrieb:
> "Joseph Huber" <joseph.huber at NOSPAM.web.de> wrote in message
> news:gt7468$1rf2$1 at gwdu112.gwdg.de...
>> Stephen Davies wrote:
>>
>>> My current work-around is to use f$getjpi("", "LOGINTIM") and see if the
>>> process is less than a second old but I hope there's a better solution.
>>>
>> Uh no, I would check if the executing proc has a master process:
>
> That does not distinguish this:
> $ spawn @CMD
>
> from this:
> $ spawn
> $ @CMD
>
>
Look at this examples:
MPIW10_HUB>@show_pids.com
3982D86E
3982D86E
$spawn
%DCL-S-SPAWNED, process HUBER_106 spawned
%DCL-S-ATTACHED, terminal now attached to process HUBER_106
$@show_pids.com
3982CD6F
3982D86E
$logout
Process HUBER_106 logged out at 28-APR-2009 19:32:50.97
%DCL-S-RETURNED, control returned to process _FTA381:
$spawn @show_pids.com
%DCL-S-SPAWNED, process HUBER_137 spawned
%DCL-S-ATTACHED, terminal now attached to process HUBER_137
3982D170
3982D86E
%DCL-S-RETURNED, control returned to process _FTA381:
$cat show_pids.com
$ write sys$output f$getjpi("","PID")
$ write sys$output f$getjpi("","MASTER_PID")
$
You see the different or same PID and MASTER_PID, depending on wether
the call is from a subprocess or in the context of the master_pid.
The same is true for Peters method of looking at the OWNER PID.
--
Joseph Huber - http://www.huber-joseph.de
More information about the Info-vax
mailing list