[OpenSIPS-Users] opensips HA resource script (for Heartbeat)

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Dec 28 19:48:19 CET 2010


Iñaki Baz Castillo wrote:
> 2010/12/28 Bogdan-Andrei Iancu <bogdan at voice-system.ro>:
>   
>> As far as I understand this will partially fix the problem, by addressing
>> the errors reported by module init functions. The errors generated by the
>> child init functions will not be caught by the parent process
>>     
>
> Hi bogdan, thanks for your response. If a worker fails to start when
> running the chil init function, doesn't the parent (main process)
> realize of it and exit?
>   
it is not about terminating, it is about the returned code. Let me give 
you an example:

1) parent process starts
2) demonize is start -> daemon process started
3) parent process still running waiting for feedback from the daemon process
4) daemon process does all the core init, does init module, all with success
5) daemon process forks the worker processes (the children procs)
6) daemon process successfully did the job, so returns success
7) parent process receives the feedback from the daemon process, so it 
also ends with success
8) return code of parent process is OK
9) children procs do child_init -> db stuff
10) on child proc fails the init -> it terminates
11) daemon proc receivs the SIG_CHILD signal and triggers the shutdown
12) everything is shutdown in a clean way

Result: return code was success, but opensips failed to start due a 
startup error.

This is why I'm saying that you need to look further than the daemon 
proc, if you want to implement a proper startup sequence and return code.

Regards,
Bogdan

-- 
Bogdan-Andrei Iancu
OpenSIPS Event - expo, conf, social, bootcamp
2 - 4 February 2011, ITExpo, Miami,  USA
www.voice-system.ro




More information about the Users mailing list