Skip to content

Commit

Permalink
Use 'erlexec' directly to avoid overwriting the 'erl' executable
Browse files Browse the repository at this point in the history
The main motivation is that on some installations the Erlang
executables are not writable, and the overwriting would fail.

The 'erl' script was initially created to fix escript,
but escript is no longer using it, so the entire script can be removed.
  • Loading branch information
chrzaszcz committed Jun 28, 2022
1 parent 891f7ab commit 730b3ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 36 deletions.
1 change: 0 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
{copy, "tools/ssl/mongooseim/dh_server.pem", "priv/ssl/fake_dh_server.pem"},
{copy, "tools/ssl/ca/cacert.pem", "priv/ssl/cacert.pem"},

{copy, "rel/files/erl", "erts-\{\{erts_vsn\}\}/bin/erl"},
%% Copy the whole directory scripts into scripts.
%% Still works, if the destination "scripts/" directory exists.
{copy, "rel/files/scripts", "./"},
Expand Down
34 changes: 0 additions & 34 deletions rel/files/erl

This file was deleted.

7 changes: 6 additions & 1 deletion rel/files/mongooseimctl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ MIM_DIR="${RUNNER_SCRIPT_DIR%/*}"
EJABBERD_VMARGS_PATH="${RUNNER_ETC_DIR}"/vm.args
START_ERL=`cat "$MIM_DIR"/releases/start_erl.data`
ERTS_VSN="${START_ERL% *}"
APP_VSN="${START_ERL#* }"
ERTS_PATH="$MIM_DIR/erts-$ERTS_VSN/bin"
ERL="$ERTS_PATH"/erl
EPMD="$ERTS_PATH"/epmd
Expand Down Expand Up @@ -264,9 +265,13 @@ ctl ()

ctlexec ()
{
export EMU=beam
export BINDIR=$ERTS_PATH
export PROGNAME=erl
CONN_NAME=$1; shift
COMMAND=$@
"$ERL" \
$ERTS_PATH/erlexec \
-boot "$MIM_DIR/releases/$APP_VSN/start_clean" \
$NAME_TYPE ${CONN_NAME} \
-noinput \
-hidden \
Expand Down

0 comments on commit 730b3ac

Please sign in to comment.