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

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Dec 28 20:42:02 CET 2010


Iñaki Baz Castillo wrote:
> 2010/12/28 Bogdan-Andrei Iancu <bogdan at voice-system.ro>:
>   
>> 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
>>     
>
> This step 10 could occur due to wrong user:passwd in a DB connection,
> am I right?
>   
not only - there are module which do load data in child_init (and not 
mod_init), like usrloc or drouting - so the failure may be cause by mem, 
bogus data, DB, DNS, etc....even configuration errors...
>   
>> 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.
>>     
>
> Ok, I understand. However I "think" (not sure now) that a fail in step
> 10 still makes the daemon (so also parent process) to properly return
> with failure code, but I must check it.
>   

I do not "think", I'm pretty sure :)  : there is the same process 
relation between parent / daemon and between daemon / worker ; just 
double checked the code. The daemon process starts the rest of the 
processes (timer, workers, TCP, module procs) without getting any 
feedback on the init success of its child processes.

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