On Tue, Feb 26, 2008 at 03:36:59PM -0800, Antonello Cruz wrote:
> > OK thanks for the information, this makes sense. Now is in.iked broken ?
> > Sure it works, but almost  accidentally because its the last (only) process
> > in the contract.
> I don't know specifics of in.iked to say if it's broken or not. But if 
> you want the service to be restarted if one of the two deamons exits and 
> you need to trap signals, I can think of one workaround. Have a process 
> fork both deamons and wait for any child to exit. If any child exits, 
> the parent process kills all other children and exits. The service will 
> be restarted because of an empty event. It is ugly, but I think it works...

Yup, that's ugly.  You can also deref NULL and dump a core file if
that's OK (but maybe it isn't, for in.iked -- you may end up with keying
material in the core that you don't want there).  I guess ugly solutions
abound:

 - Have a pipe between each pair of processes and make sure it gets
   polled for errors.  If the pipe goes away then exit, which will close
   any other such pipes, causing all your procs to exit...

 - Share a single event port (which requires that all procs inherit it
   from an ancestor or else be the ancestor) and the use port_alert()
   when exiting to cause the other procs to notice and exit too.

Nico
-- 

Reply via email to