[omniORB] Re: omniORB and fork()

Stewart Gebbie stewart@global.co.za
Mon, 21 Aug 2000 15:19:06 +0200


Hi,

Thanks for the reply. I eventually found some references in the
omniorb-list archives (April 2000). It seems that I had not 
explicitly linked against -lpthread. Without this the ORB simply 
exits. The moment all the progs are explicitly linked with
-lpthread every thing works fine.

Stewart

On Mon, Aug 21, 2000 at 11:32:58AM +0100, Sai-Lai Lo wrote:
> 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

-- 
Stewart Gebbie <stewart@global.co.za>
(H) +27 11 477 2601, +27 83 332 0573
(W) +27 11 717 6241 (Wits, CB214)