Mark Fenwick wrote: > >>> What you say is true, the daemon (in.iked in this case) does trap the signal >>> and exit, but if the only daemon to be started from this service is in.iked >>> then killing it does cause the service to be restarted. If this is wrong >>> then I need to modify in.iked so that it behaves correctly. >> That's because the last member of the contract exited and an empty event >> was generated. The service is supposed to be restarted in case the last >> process exited. >> When you have two deamons running and kill one, no event is generated >> because the signal is handled (events are sent by the kernel) and the >> contract still has processes in it. >> >> > > 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...
-Antonello