[omniORB] Re: omniORB and fork()

Sai-Lai Lo S.Lo@uk.research.att.com
21 Aug 2000 11:32:58 +0100


I assume you are talking about linux, fork() and execv() works fine as far
as I can tell.

Example, this works with eg3_impl:

char* Echo_i::echoString(const char* mesg)
{
  if (fork() == 0) {
    char* argv[] = { "date", 0 };
    execv("/bin/date",argv);
  }
  else {
    int status;
    wait(&status);
  }

  return CORBA::string_dup(mesg);
}

Sai-Lai

>>>>> Stewart Gebbie writes:

> Firstly I would like to thank the developers of omniORB for 
> making it avaiable under GPL, it's a great tool.

> I am writting a small CORBA based program using omniORB and 
> as a part of it I need to execute other UNIX programs. That
> is I need to be able to fork() off and execv() a different 
> excecutable.

> Unfortunately whenever I do this my original process terminates
> (it does not show any error messages though). If I just fork()
> and then call exit(1) in the child then everything carries on
> fine, but the moment I call execv() the ORB shuts down.

> At the moment I am still usign omniORB 2.8.0 for Linux. I have
> not yet ported my code to omniORB 3.0.x.

> Can you provide me with any suggestions or documents that might
> help me solve this problem? Or are there other sites I can look
> at or post questions?

-- 
Sai-Lai Lo                                   S.Lo@uk.research.att.com
AT&T Laboratories Cambridge           WWW:   http://www.uk.research.att.com 
24a Trumpington Street                Tel:   +44 1223 343000
Cambridge CB2 1QA                     Fax:   +44 1223 313542
ENGLAND