[sr-dev] git:master: proper LSB return values of init script

Klaus Darilion klaus.mailinglists at pernau.at
Tue Mar 15 15:28:34 CET 2011



On 15.03.2011 11:03, Iñaki Baz Castillo wrote:
> 2011/3/15 Klaus Darilion<klaus.mailinglists at pernau.at>:
>>> Hi Klaus, I agree, but in case of "stop" action is should return 0 as
>>> the daemon is indeed stoped (LSB compliant).
>>
>> Is it really stoped? Kamailio is not configured so it is hard to tell if
>> it is running or not. The script does not perform any checks to find out
>> if Kamailio is stopped, thus I think it is more correct to indicate an
>> error.
>
> Hi Klaus, I don't agree. If the daemon is not enabled
> (/etc/default/kamailio has RUN=NO) then it must be uspposed not to be
> running. In fact, you can not run the daemon using the init script
> (due to RUN=NO).
> Note that the init script is supposed to manage a process which has
> been started using same init script (so you control de PID file and
> so). If you run kamailio from command line by setting some other PID
> file then the "stop" action of the init script would not find the PID
> file so would also return 0. This is, a init script is not supposed to
> control a process started without its init script.
>
> So I insist that the stop action should return 0 in case of kamailio
> not enabled in its default file.

(this whole discussion is very theoretically)
So, what if I start kamailio with init script. Then I configure RUN=NO 
and then I call "stop". Then it will report 0 although kamailio is still 
running. Anyway, IMo if the service is not configured it should not 
report success.

regards
klaus

PS: Feel free to fix it, I won't fix it as IMO it is not a bug.



More information about the sr-dev mailing list