While implementing XECS-1661 (Implement new process execution class
SipxProcess), we were trying to use the "Launch" and "wait" methods in
osProcessLinux to Launch an application and then wait for its result to
provide this back to the Supervisor.  Unfortunately, we would never
actually get back the result set by the child process. 

In investigating the "waitpid" functionality used in the osProcessLinux
"wait" method, I noticed that when the child process exited, the return
value was -1 (ECHILD) and no process result/return code was available.
This type of error will occur if we've set things up to ignore Child
signals (SIGCHLD, SIG_IGN) and let the system clean up the process.  The
negative effect of course of doing this, is that no result can be
obtained.  The "Launch" method of osProcessLinux sets things up to
ignore any child signals.

I would like to propose a change to the "Launch" method so that we do
NOT set things up to ignore the child signals so that the wait function
will then be able to obtain the child process result/return code.  When
the waitpid is used and the process returns, the process will be cleaned
up automatically after obtaining the result.  The potential negative
side effect of not ignoring the child signals is that if the parent
doesn't do a wait, the child process will remain in "defunct" status
until the parent exits.  This negative side effect though is the result
of poor programming.

If there are no objections, I'll open a new JIRA issue to change this so
that I can proceed with the proper solution to XECS-1661.

Thanks
Raymond  
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev

Reply via email to