ejabberdctl.template: Show meaningful error when ERL_DIST_PORT is in use

This commit is contained in:
Badlop
2025-12-04 15:42:03 +01:00
parent c35605ecce
commit a22c88a5c0
+11 -1
View File
@@ -312,7 +312,17 @@ stop_epmd()
# if all ok, ensure runtime directory exists and make it current directory # if all ok, ensure runtime directory exists and make it current directory
check_start() 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%@*} " && { "$EPMD" -names 2>/dev/null | grep -q " ${ERLANG_NODE%@*} " && {
pgrep -f "$ERLANG_NODE" >/dev/null && { pgrep -f "$ERLANG_NODE" >/dev/null && {
echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running." echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running."