[sr-dev] Patches to get proper status code in daemonize mode

Olle E. Johansson oej at edvina.net
Tue Apr 20 13:37:56 CEST 2010


20 apr 2010 kl. 13.20 skrev Henning Westerholt:

> On Monday 19 April 2010, Iñaki Baz Castillo wrote:
>>> But if we could allow the init script to block for some time, what about
>>> this (IMHO much simpler) approach:
>>> 
>>> * kamailio gets started as usual
>>> * init script sleeps for some time (e.g. 5-10 seconds, configurable)
>>> * init script checks if the process is really running (process list,
>>> FIFO, SIP OPTIONS..)
>>> * init script returns the appropriate return code
>>> 
>>> Not sure if you already considered this.
>> 
>> I've done the same for some other services wrongly managing exit
>> status codes. Sincerely I consider it a bad workaround, not reliable
>> and ugly (why to force a timeout if the init script could exit
>> quickly?). Also note that usually HeartBeat waits just a limited
>> ammount of seconds when it starts a service.
> 
> Hi Iñaki,
> 
> i've not yet looked into your patch, if its not that invasive and fairly easy 
> to implement (as mentioned in later messages) its fine with me. Implementing 
> it in the init script would be indeed more like a workaround. It would not 
> help in the case when the daemon gets started directly.

The preference should always be to have proper exit codes.
I don't know how much sleeps the various distros allow you to implement
in the rc scripts. Curious if there are guidelines for it.

/O


More information about the sr-dev mailing list