Skip to content

Commit

Permalink
Change the chkconfig script to 'nodetool eval' with inline erlang
Browse files Browse the repository at this point in the history
for handling consult. Seems cleaner than having a couple of files
to handle a simple task - this is what we were trying to achieve
in Leeds.
  • Loading branch information
Martin Cox committed May 10, 2019
1 parent 1e6f181 commit 74efdcc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
{template, "rel/files/riak-debug", "bin/riak-debug"},
{template, "rel/files/riak-chkconfig", "bin/riak-chkconfig"},
{template, "rel/files/riak-repl", "bin/riak-repl"},
{template, "rel/files/check_riak_config", "bin/check_riak_config"},

{copy, "rel/files/check_ulimit", "bin/hooks/prestart/check_ulimit"}
]},
Expand Down
11 changes: 0 additions & 11 deletions rel/files/check_riak_config

This file was deleted.

13 changes: 12 additions & 1 deletion rel/files/riak-chkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,16 @@
## "vm.args = $VMARGS_PATH"
## "app.config = $CONFIG_PATH"

$ERTS_DIR/bin/escript $RELEASE_ROOT_DIR/bin/check_riak_config $CONFIG_PATH
CODE=" try
{ok, _} = file:consult(\"$CONFIG_PATH\"),
io:format(\"config is OK\\n\"),
halt(0)
catch
_:_ ->
io:format(\"Error reading ~p\\n\", [\"$CONFIG_PATH\"]),
halt(1)
end."

$BINDIR/erl -noshell -boot start_clean -eval "$CODE"

echo $CUTTLE_CONF

0 comments on commit 74efdcc

Please sign in to comment.