diff --git a/ecs/bin/ejabberdctl b/ecs/bin/ejabberdctl index 451acba..32ab08b 100755 --- a/ecs/bin/ejabberdctl +++ b/ecs/bin/ejabberdctl @@ -72,6 +72,11 @@ done : "${EJABBERD_LOG_PATH:="$LOGS_DIR/ejabberd.log"}" : "${SPOOL_DIR:="$HOME_DIR/database/$ERLANG_NODE"}" +[ -n "$ERLANG_COOKIE" ] && { + echo "$ERLANG_COOKIE" > "$HOME"/.erlang.cookie + chmod 400 "$HOME"/.erlang.cookie +} + # define erl parameters ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES $ERL_OPTIONS" if [ -n "$FIREWALL_WINDOW" ] ; then @@ -109,17 +114,6 @@ export CONTRIB_MODULES_PATH export CONTRIB_MODULES_CONF_DIR export ERL_LIBS -# export dynamic library path -case $(uname -m) in - i[3456]86) cpu="x86" ;; - i86pc) cpu="x86" ;; - armv7*) cpu="armhf" ;; - *) cpu=$(uname -m | tr A-Z a-z) ;; -esac -os=$(uname -s | tr A-Z a-z) -export LD_FALLBACK_LIBRARY_PATH="$ROOT_DIR"/lib/${os}-${cpu} -export DYLD_FALLBACK_LIBRARY_PATH="$LD_FALLBACK_LIBRARY_PATH" - # run command either directly or via su $INSTALLUSER exec_cmd() { diff --git a/ecs/conf/ejabberdctl.cfg b/ecs/conf/ejabberdctl.cfg index bd41386..45e8838 100644 --- a/ecs/conf/ejabberdctl.cfg +++ b/ecs/conf/ejabberdctl.cfg @@ -45,8 +45,7 @@ # it's possible to make Erlang use a defined range of port (instead of dynamic # ports) for node communication. # -# Default: 4370-4349 -# Example: 4370-4399 is maximum range allowed by default on container +# Default: 4370-4379 # #FIREWALL_WINDOW= @@ -111,9 +110,6 @@ # ejabberd is started from an init.d script options -noshell and -detached are # added implicitly. See erl(1) for more info. # -# It might be useful to add "-pa /usr/local/lib/ejabberd/ebin" if you -# want to add local modules in this path. -# # Default: "" # #ERL_OPTIONS="" @@ -136,6 +132,19 @@ # #ERLANG_NODE=ejabberd@$(hostname) +#. +#' ERLANG_COOKIE: Erlang cookie for inter-node communication +# +# When using ejabberd in cluster, you need all nodes to share +# the same erlang cookie. If not defined, a random value is used +# at node first start, which prevent clustering to work. Setting +# a defined cookie for all your nodes is needed to setup cluster. +# +# Default: "" +# +#ERLANG_COOKIE="" + +#. #. #' EJABBERD_PID_PATH: ejabberd PID file #