Browse Source

ejabberd: wait until ejabberd is up and running

ejabberdctl start returns immediately even if ejabberd is not ready
yet. Add a call to ejabberdctl started just after to wait until the
status says ejabberd is up and running.

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Johan Oudinet 10 years ago
parent
commit
fb1e02ed35
1 changed files with 6 additions and 0 deletions
  1. 6 0
      package/ejabberd/S50ejabberd

+ 6 - 0
package/ejabberd/S50ejabberd

@@ -25,6 +25,12 @@ case "$1" in
         mkrundir || exit 1
         mkrundir || exit 1
         echo -n "Starting ejabberd... "
         echo -n "Starting ejabberd... "
         ctl start --spool "$SPOOLDIR"
         ctl start --spool "$SPOOLDIR"
+        # Wait until ejabberd is up and running.
+        if ctl started; then
+            echo "done"
+        else
+            echo "failed"
+        fi
         ;;
         ;;
     stop)
     stop)
         echo -n "Stopping ejabberd... "
         echo -n "Stopping ejabberd... "