erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

rpcterms analog. #856

Closed loguntsov closed 3 years ago

loguntsov commented 3 years ago

Hello.

I found rpcterms was deleted. I need call module:function from remote node with showing of STDOUT (means everything what shows by io:format in remote node). I know how i can do it with simple erl calling:

erl -sname console -setcookie "$cookie" -noshell -hidden -eval "GroupLeader = rpc:call($nodename, erlang, group_leader, []), rpc:call($nodename, erlang, group_leader, [ GroupLeader, erlang:group_leader() ]), Status = rpc:call($nodename,rc_cli,run,[<<\"$params\">>]), io:format(\"Status: ~p~n\", [ Status ]), init:stop(Status)."

but i wanted find relx-way to do same thing and more easy way.

rpc command doesn't shows anything from remote node.

Could you point me for some way ? Thank you.

ferd commented 3 years ago

You can set USE_NODETOOL=true to bring back the old behaviour until erl_call can be found to have a workaround for the output not showing.

loguntsov commented 3 years ago

Hello, @ferd

If you means to use like this:

USE_NODETOOL=true ./bin/mzbench_api rpc mzb_api_server config_info

it is not working for me. May be it is related of #853 ? I have Erlang 23.

ferd commented 3 years ago

I'm referring to this feature: https://github.com/erlware/relx/pull/835 which is tested and should work if you have a recent enough rebar3 version.

loguntsov commented 3 years ago

Thank you. It's working. What is best way to build project by rebar3 without including rebar3 into repository ?

ferd commented 3 years ago

I just install it on my dev machine and call it from wherever