Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Generic notification of process death - why not?: (10 Items)
   
Generic notification of process death - why not?  
Hi,

I'm pretty sure this has been asked before, but I cannot find the answer. 

In QNX4, a process could set the _PPF_INFORM process flag to receive a message from the kernel whenever any process died
.

In QNX6, there is no such mechanism any longer - at least not for being informed of the death of _any_ process for _any_
 reason. We can only get notification under certain conditions - for session 1, for child processes, for client 
processes connected to us, or for processes terminating abnormally.

Is there a specific reason that the process manager does not provide a generic process death notification mechanism? If 
so, what is that reason?

Thanks in advance,
Thomas
Re: Generic notification of process death - why not?  
This might shed some light as to why it isn't supported anymore:

http://www.qnx.com/developers/qnx4/qnx4kb/solution.html?code=9414
Re: Generic notification of process death - why not?  
Finally this might be an interesting workaround:

http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/prog/process.html#id24
RE: Generic notification of process death - why not?  
Hi Gervais,

all nice and jolly, but I was talking about __all__ process terminations, 
not only, for example, the crashes (abnormal terminations).

A simple pulse could have done, with the pulse value being the process id.

Cheers,
Thomas

-----Original Message-----
From: Gervais Mulongoy [mailto:community-noreply@qnx.com] 
Sent: Montag, 7. November 2011 14:59
To: ostech-core_os
Subject: Re: Generic notification of process death - why not?

Finally this might be an interesting workaround:

http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/prog/process.html#id24




_______________________________________________

OSTech
http://community.qnx.com/sf/go/post89900
Re: Generic notification of process death - why not?  
Again as a workaround, you could use a starter process that registers
the pathname /proc/starter, fork()s and exec()s the chosen binary and
finally calls wait(). Starter would be like a replacement for the on
utility.
AW: Re: Generic notification of process death - why not?  
Gervais, that is _not_ my question. My question is what the reason was to not implement a generic mechanism.

- Thomas

----- Originalnachricht -----
Von: Gervais Mulongoy [mailto:community-noreply@qnx.com]
Gesendet: Monday, November 07, 2011 09:19 AM
An: ostech-core_os <post89903@community.qnx.com>
Betreff: Re: Generic notification of process death - why not?

Again as a workaround, you could use a starter process that registers
the pathname /proc/starter, fork()s and exec()s the chosen binary and
finally calls wait(). Starter would be like a replacement for the on
utility.



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post89903
RE: Re: Generic notification of process death - why not?  
How is the kernel supposed to know what event to send?  Like with procmgr_event_notify(), the event would have to be 
given to the kernel, and then MsgDeliverEvent() invoked when the process exits.  The problem then, is that the server 
delivering the message does not know what the message is, and cannot take a chance to modify it, so there's no place to 
store the PID of the exiting process.  The best that could happen is you would get your event on every process death, 
and would then have to scan to determine which PID.

> -----Original Message-----
> From: Thomas Haupt [mailto:community-noreply@qnx.com]
> Sent: November-07-11 11:07 AM
> To: ostech-core_os
> Subject: AW: Re: Generic notification of process death - why not?
> 
> Gervais, that is _not_ my question. My question is what the reason was to
> not implement a generic mechanism.
> 
> - Thomas
> 
> ----- Originalnachricht -----
> Von: Gervais Mulongoy [mailto:community-noreply@qnx.com]
> Gesendet: Monday, November 07, 2011 09:19 AM
> An: ostech-core_os <post89903@community.qnx.com>
> Betreff: Re: Generic notification of process death - why not?
> 
> Again as a workaround, you could use a starter process that registers the
> pathname /proc/starter, fork()s and exec()s the chosen binary and finally
> calls wait(). Starter would be like a replacement for the on utility.
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post89903
> 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post89913
AW: RE: Re: Generic notification of process death - why not?  
I had figured that since we deliver specific pulses on various occasions (e.g., thread death) something like that would 
have been possible for processes as well. But I see your point - it's a bit tricky, architecturally.

----- Originalnachricht -----
Von: David Sarrazin [mailto:community-noreply@qnx.com]
Gesendet: Monday, November 07, 2011 11:09 AM
An: ostech-core_os <post89915@community.qnx.com>
Betreff: RE: Re: Generic notification of process death - why not?

How is the kernel supposed to know what event to send?  Like with procmgr_event_notify(), the event would have to be 
given to the kernel, and then MsgDeliverEvent() invoked when the process exits.  The problem then, is that the server 
delivering the message does not know what the message is, and cannot take a chance to modify it, so there's no place to 
store the PID of the exiting process.  The best that could happen is you would get your event on every process death, 
and would then have to scan to determine which PID.

> -----Original Message-----
> From: Thomas Haupt [mailto:community-noreply@qnx.com]
> Sent: November-07-11 11:07 AM
> To: ostech-core_os
> Subject: AW: Re: Generic notification of process death - why not?
> 
> Gervais, that is _not_ my question. My question is what the reason was to
> not implement a generic mechanism.
> 
> - Thomas
> 
> ----- Originalnachricht -----
> Von: Gervais Mulongoy [mailto:community-noreply@qnx.com]
> Gesendet: Monday, November 07, 2011 09:19 AM
> An: ostech-core_os <post89903@community.qnx.com>
> Betreff: Re: Generic notification of process death - why not?
> 
> Again as a workaround, you could use a starter process that registers the
> pathname /proc/starter, fork()s and exec()s the chosen binary and finally
> calls wait(). Starter would be like a replacement for the on utility.
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post89903
> 
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post89913




_______________________________________________

OSTech
http://community.qnx.com/sf/go/post89915
Re: Generic notification of process death - why not?  
Hi Thomas,

What about using TraceEvent()?   You could listen for _NTO_TRACE_PROCESS class messages to monitor process creation and 
destruction.

-Will
AW: Re: Generic notification of process death - why not?  
I've even thought of that, but consider it quite a hack... Though _that_ would work. Still, it doesn't explain my 
original question...

----- Originalnachricht -----
Von: Will Miles [mailto:community-noreply@qnx.com]
Gesendet: Monday, November 07, 2011 09:32 AM
An: ostech-core_os <post89906@community.qnx.com>
Betreff: Re: Generic notification of process death - why not?

Hi Thomas,

What about using TraceEvent()?   You could listen for _NTO_TRACE_PROCESS class messages to monitor process creation and 
destruction.

-Will



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post89906