diff --git a/ejabberdctl.template b/ejabberdctl.template index 972afe0bc..cec891a79 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -312,7 +312,17 @@ stop_epmd() # if all ok, ensure runtime directory exists and make it current directory check_start() { - [ -n "$ERL_DIST_PORT" ] && return + [ -n "$ERL_DIST_PORT" ] && { + netstat -nl | grep ":5210" >/dev/null && { + echo "Error: The file ejabberdctl.cfg has configured ERL_DIST_PORT=$ERL_DIST_PORT" + echo " but the port 5210 is already in use." + echo " Stop that program or configure a different ERL_DIST_PORT" + echo "" + netstat -nlp | grep ":5210" + echo "" + } + return + } "$EPMD" -names 2>/dev/null | grep -q " ${ERLANG_NODE%@*} " && { pgrep -f "$ERLANG_NODE" >/dev/null && { echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running."