[sr-dev] [RtpProxy] debian init patch to be LSB compliant

Iñaki Baz Castillo ibc at aliax.net
Sun May 31 14:30:46 CEST 2009


Hi, I attach a ptch for rtpproxy Debian init script which allows it being LSB 
compliant.
Basically I add "--oknodo" option to all calls to "start-stop-daemon" which, 
by default, is not LSB compliant.

Being LSB compliant is really useful when we want to manage a service (like 
RtpProxy) using some failover system as HeartBeat, which relies on *exact* 
reply code of the init scripts.

About LSB specification [1] for init scripts which I refer to:

---------------------
"For all other init-script actions, the init script shall return an exit
status of zero if the action was successful. Otherwise, the exit status
shall be non-zero, as defined below. In addition to straightforward
success, the following situations are also to be considered successful: 
- Restarting a service (instead of reloading it) with the force-reload
argument
- Running start on a service already running
- Running stop on a service already stopped or not running
- Running restart on a service already stopped or not running
- Running try-restart on a service already stopped or not running"

So if I start a service that is already running I should receive 0, but
"start-stop-daemon" returns 1 (error).

The option "--oknodo" changes the behaviour to the LSB recomendations but many
services in Debian don't use this option and return 1 in the case I've
quotted. This is very problematic for me when I try to use a Debian
service init script with HeartBeat that expects to receive a 0.
-----------------------


So adding "--oknodo" to the init script, "/etc/init.d/rtpproxy start" returns 
0 (no error) even if RtpProxy is already running, and "/etc/init.d/rtpproxy 
stop" returns 0 (no error) even if RtpProxy is not running (as LSB mandates).

Note however that in Debian Lenny the default behaviour of "start-stop-daemon" 
has changed to implement this LSB compliant behaviour by default.
This is the bug report I opened in Debian for this issue:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=426877




[1] LSB specifications about init script actions:
http://www.linux-foundation.org/spec/refspecs/LSB_3.0.0/LSB-Core-generic/LSB-
Core-generic/iniscrptact.html


-- 
Iñaki Baz Castillo <ibc at aliax.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtpproxy.init.patch
Type: text/x-patch
Size: 1017 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20090531/3c629a51/attachment-0001.bin>


More information about the sr-dev mailing list