<div dir="ltr"><div>Hi,</div><div><br></div><div>I tried that before like this:</div><div>$ erl -setcookie proxy -proto_dist inet_tls -ssl_dist_optfile file_with_pem -name 'stop-node@host' -s rpc call target-node@host init stop []<br>Erlang/OTP 24 [erts-12.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]<br><br>{"init terminating in do_boot",{undef,[{rpc,call,[['target-node@host',init,stop,'[]']],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}<br>init terminating in do_boot ({undef,[{erpc,call,[[_]],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})<br><br>Crash dump is being written to: erl_crash.dump...done</div><div><br></div><div>$</div><div><br></div><div>But I looked for an erl_call based solution.<br></div><div><br></div><div>The thing is in that way the signature for rpc:call/4 will never be matched because of the way -s flag <br></div><div>packs the function call and parameters. <br></div><div><br></div><div>Basically, it sends all parameters wrapped into a list, but the signature of rpc:call/4 is this:<span class="gmail-title-name"><br></span></div><div><span class="gmail-title-name">rpc:call(Node, Module, Function, Args)</span></div><div><span class="gmail-title-name">and we get this</span><span class="gmail-title-name"> with -s flag:<br></span></div><div><span class="gmail-title-name">rpc:call([Node, Module, Function, Args])</span></div><div><span class="gmail-title-name"></span></div><div><br></div><div>And also the empty list argument needed for rpc:call is wrapped in '' like this: '[]'</div><div><br></div><div>Normally, erl_call must be able to talk to tls nodes not only with tcp nodes.</div><div><br></div><div>I founded a workaround if you are on elixir node:</div><div>$ elixir --name stop-node@host --cookie proxy --erl "-proto_dist inet_tls" --rpc-eval target-node@host System.stop</div><div><br></div><div>Again, it would be nice if erl would have a switch like --rpc-eval </div><div><br></div><div>Thanks,</div><div><br></div><div>Bogdan</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 28, 2022 at 8:13 PM Luke Bakken <<a href="mailto:luke@bakken.io">luke@bakken.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I don't believe that erl_call supports the "inet_tls" distribution<br>
protocol - <a href="https://www.erlang.org/doc/man/erl_call.html" rel="noreferrer" target="_blank">https://www.erlang.org/doc/man/erl_call.html</a><br>
<br>
At least, it's not documented in the manual page.<br>
<br>
If I try to connect to a TLS dist node using remsh, but without<br>
specifying certs, I get a function_clause error in<br>
public_key,pkix_decode_cert due to the lack of certificates.<br>
<br>
My guess is that, provided that you configure certificates for TLS<br>
distribution, you could accomplish what you want by starting a second<br>
node, connecting the "usual way" via addressing the other node, and<br>
then use the rpc module to stop the node.<br>
<br>
Thanks,<br>
Luke<br>
<br>
On Fri, Mar 25, 2022 at 2:13 AM Bogdan Andu <<a href="mailto:bog495@gmail.com" target="_blank">bog495@gmail.com</a>> wrote<br>
><br>
> Hello,<br>
><br>
> I want to stop a node started with switch -proto_dist inet_tls :<br>
> $ /usr/lib/erlang/lib/erl_interface-5.2.1/bin/erl_call -q -c proxy -name 'node-name@host-name'<br>
><br>
> doesn't kill the node:<br>
> $ erl -name node-name@host-name -setcookie proxy -proto_dist inet_tls<br>
> Erlang/OTP 24 [erts-12.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]<br>
><br>
> Eshell V12.3 (abort with ^G)<br>
> (node-name@host-name)1> =NOTICE REPORT==== 25-Mar-2022::08:55:56.447550 ===<br>
> TLS server: In state hello at tls_record.erl:564 generated SERVER ALERT: Fatal - Unexpected Message<br>
> - {unsupported_record_type,0}<br>
><br>
> (node-name@host-name)1><br>
><br>
> Because the ssl handshake fails the node does not 'catch' the<br>
> command to terminate itself.<br>
><br>
><br>
> The execution of command shows the error:<br>
> $ /usr/lib/erlang/lib/erl_interface-5.2.1/bin/erl_call -c proxy -name node-name@host-name -a "init stop"<br>
> erl_call: failed to connect to node node-name@host-name<br>
><br>
> Actually the erl_call node connects to 'node-name@host-name' but is rejected with the same error as above.<br>
><br>
> Because the erl_call cannot connect to a tls erlang node, erl_call cannot stop suc node.<br>
><br>
> If the node is started like this:<br>
> $ erl -name node-name@host-name -setcookie proxy -proto_dist inet_tcp<br>
><br>
> erl_call is able to stop it.<br>
><br>
> Is there a solution to this problem?<br>
><br>
> Cheers,<br>
><br>
> Bogdan<br>
><br>
</blockquote></div>