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 <[email protected]>
--- rtpproxy.init.old 2006-08-15 09:12:09.000000000 +0200 +++ rtpproxy.init 2009-05-31 14:16:06.000000000 +0200 @@ -29,13 +29,13 @@ case "$1" in start) echo -n "Starting $DESC: " - start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + start-stop-daemon --start --oknodo --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " - start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; @@ -58,10 +58,10 @@ # just the same as "restart". # echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile \ + start-stop-daemon --stop --oknodo --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON sleep 1 - start-stop-daemon --start --quiet --pidfile \ + start-stop-daemon --start --oknodo --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;;
_______________________________________________ Devel mailing list [email protected] http://lists.rtpproxy.org/mailman/listinfo/devel
