Skip to content

Commit

Permalink
ejabberdctl: Detect problem running iex and show explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Jan 8, 2024
1 parent df99c6c commit da15c9c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ejabberdctl.template
Expand Up @@ -202,6 +202,24 @@ check_etop_result()
fi
}

check_iex_result()
{
result=$?
if [ $result -eq 127 ] ; then
echo ""
echo "It seems there was some problem finding 'iex' binary from Elixir."
echo "Probably ejabberd was compiled with Rebar3 and Elixir disabled, like:"
echo " ./configure"
echo "which is equivalent to:"
echo " ./configure --with-rebar=rebar3 --disable-elixir"
echo "To use 'iex', recompile ejabberd enabling Elixir or using Mix:"
echo " ./configure --enable-elixir"
echo " ./configure --with-rebar=mix"
echo ""
exit $result
fi
}

help()
{
echo ""
Expand Down Expand Up @@ -331,10 +349,12 @@ case $1 in
debugwarning
set_dist_client
exec_iex "$(uid debug)" --remsh "$ERLANG_NODE"
check_iex_result
;;
iexlive)
livewarning
exec_iex "$ERLANG_NODE" --erl "$EJABBERD_OPTS"
check_iex_result
;;
ping)
PEER=${2:-$ERLANG_NODE}
Expand Down

0 comments on commit da15c9c

Please sign in to comment.