diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index 1dd82ceaa..24a0544c8 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -16,7 +16,7 @@ , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.10.2"}}} , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.1"}}} , {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v4.0.1"}}} %% todo delete when plugins use hocon - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.9.0"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.9.6"}}} , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {branch, "2.0.4"}}} , {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}} , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.13.0"}}} diff --git a/bin/emqx b/bin/emqx index a5f76ac72..f0a53cd45 100755 --- a/bin/emqx +++ b/bin/emqx @@ -3,6 +3,11 @@ # ex: ts=4 sw=4 et set -e +set -o pipefail + +if [ -n "$DEBUG" ]; then + set -x +fi ROOT_DIR="$(cd "$(dirname "$(readlink "$0" || echo "$0")")"/..; pwd -P)" # shellcheck disable=SC1090 @@ -196,6 +201,7 @@ call_hocon() { export RUNNER_ROOT_DIR export REL_VSN "$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" hocon "$@" + return $? } # Run an escript in the node's environment @@ -251,7 +257,7 @@ generate_config() { ARG_KEY=$(echo "$ARG_LINE" | awk '{$NF="";print}') ARG_VALUE=$(echo "$ARG_LINE" | awk '{print $NF}') ## use the key to look up in vm.args file for the value - TMP_ARG_VALUE=$(grep "^$ARG_KEY" "$TMP_ARG_FILE" | awk '{print $NF}') + TMP_ARG_VALUE=$(grep "^$ARG_KEY" "$TMP_ARG_FILE" || true | awk '{print $NF}') ## compare generated (to override) value to original (to be overriden) value if [ "$ARG_VALUE" != "$TMP_ARG_VALUE" ] ; then ## if they are different @@ -365,7 +371,7 @@ if [ -z "$COOKIE" ]; then fi # Support for IPv6 Dist. See: https://github.com/emqtt/emqttd/issues/1460 -PROTO_DIST=$(grep -E '^[ \t]*cluster.proto_dist[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | awk -F"= " '{print $NF}') +PROTO_DIST="$(call_hocon -s emqx_schema -c "$RUNNER_ETC_DIR"/emqx.conf get cluster.proto_dist | tr -d \")" if [ -z "$PROTO_DIST" ]; then PROTO_DIST_ARG="" else diff --git a/rebar.config b/rebar.config index ae87d37bd..c932362c6 100644 --- a/rebar.config +++ b/rebar.config @@ -61,7 +61,7 @@ , {observer_cli, "1.6.1"} % NOTE: depends on recon 2.5.1 , {getopt, "1.0.1"} , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.13.0"}}} - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.9.0"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.9.6"}}} , {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.2.1"}}} ]}.