[Info-vax] Check if a process will auto-terminate
Joseph Huber
joseph.huber at NOSPAM.web.de
Wed Apr 29 10:32:37 EDT 2009
Stephen Davies wrote:
>
> "Joseph Huber" <joseph.huber at NIRWANA.web.de> wrote in message
> news:gt7ntt$65s$1 at online.de...
>> The original question:
>> The reason is that I have updated a command file to spawn a subprocess
>> then
>> exit but some legacy calls to the command file already spawn the command
>> file, resulting in the sub-sub-process terminating almost immediately
>> because its parent terminates.
>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>> This happens ONLY if SPAWN/NOWAIT was used, otherwise the parent does NOT
>> terminate before @CMD exits!
>
> Within CMD there is a SPAWN/NOWAIT.
> Therefore the problem happens with both "SPAWN @CMD" and "SPAWN/NOWAIT
> @CMD" However, the legacy calls do use "SPAWN/NOWAIT @CMD"
> So if there is a way to only detect this, it might still be useful.
Exactly what I had in mind from the beginning !
And no, there is no way to avoid it other than change the "legacy calls":
they really should do what I and Peter said: check if the commandfile
executes in a subprocess (by comparing master_pid to pid , or owner to
empty), and if yes do SPAWN, else SPAWN/NOWAIT can be done.
Checking if the parent is in hibernation using f$getjpi(owner,"STATE") could
be a possibility, but I am not sure if it is sufficient: in a similar way
LOGINTIME checking for 1 second difference is also only approximately
working.
--
Joseph Huber, http://www.huber-joseph.de
More information about the Info-vax
mailing list