2011/6/10 Iñaki Baz Castillo <ibc(a)aliax.net>et>:
Ok, it's not a problem in kamailio code, but
just in the kamailio init
script. It fails and always return 0. I will inspect it.
I've found the problem. The init script is as follows:
---------------------
set -e
[...]
case "$1" in
start|debug)
[...]
echo -n "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $OPTIONS || echo -n " already running"
echo "."
;;
---------------------
It's very wrong:
- It does not use --oknodo option, so in case the daemon is already
running the method return 1 and "echo 'already running'" is printed.
So finally it retuns 0 (OK). Yes, it seems correct but...
- In case start-stop-daemon returns error (!= 0) due to a *real*
error, then "already running" is also printed so 0 returned. Wrong.
The problem was present in debian init script for "leeny", "squeeze"
and "lucid". However the init script for generic "debian" does the
work correctly.
Anyhow I've improved all the deb init scripts to behave correctly: