From 2a6ea7926026dfd0a09fb4a315dec9040f596d51 Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 28 Aug 2023 12:30:09 +0200 Subject: [PATCH] When building OTP release with mix, keep ERLANG_NODE=ejabberd@localhost This updates the mix.exs code from commit 8ca12d4 (ejabberd 21.07) Consequently, no need in make-binaries to update ERLANG_NODE. The ecs docker image 23.04 got a similar change in https://github.com/processone/docker-ejabberd/pull/73/commits/f81905d5e315d2eb813a715b51d4a8351a7d4e6b --- mix.exs | 3 +-- tools/make-binaries | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mix.exs b/mix.exs index d190e9da0..bb82b6471 100644 --- a/mix.exs +++ b/mix.exs @@ -271,8 +271,7 @@ defmodule Ejabberd.MixProject do Mix.Generator.copy_template("ejabberdctl.example1", "ejabberdctl.example2", assigns) execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.example2> ejabberdctl.example2a") Mix.Generator.copy_template("ejabberdctl.example2a", "ejabberdctl.example2b", assigns) - execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.example2b > ejabberdctl.example3") - execute.("sed -e 's|^ERLANG_NODE=ejabberd@localhost|ERLANG_NODE=ejabberd|g' ejabberdctl.example3 > ejabberdctl.example4") + execute.("sed -e 's|{{\\(\[_a-z\]*\\)}}|<%= @\\1 %>|g' ejabberdctl.example2b > ejabberdctl.example4") execute.("sed -e 's|^ERLANG_OPTS=\"|ERLANG_OPTS=\"-boot ../releases/#{release.version}/start_clean -boot_var RELEASE_LIB ../lib |' ejabberdctl.example4 > ejabberdctl.example5") execute.("sed -e 's|^INSTALLUSER=|ERL_OPTIONS=\"-setcookie \\$\\(cat \"\\${SCRIPT_DIR%/*}/releases/COOKIE\")\"\\nINSTALLUSER=|g' ejabberdctl.example5 > ejabberdctl.example6") Mix.Generator.copy_template("ejabberdctl.example6", "#{ro}/bin/ejabberdctl", assigns) diff --git a/tools/make-binaries b/tools/make-binaries index 442edfda4..d0398d6d3 100755 --- a/tools/make-binaries +++ b/tools/make-binaries @@ -409,7 +409,6 @@ edit_ejabberdctl() sed -i \ -e "2iexport TERM='internal'" \ -e '/ERL_OPTIONS=/d' \ - -e 's|^ERLANG_NODE=ejabberd$|ERLANG_NODE=ejabberd@localhost|' \ -e 's|_DIR:=".*}/|_DIR:="/opt/ejabberd/|' \ -e 's|/database|/database/$ERLANG_NODE|' \ "$code_dir/bin/${rel_name}ctl"