[erlang-questions] Quick connect to another node with erl

Loïc Hoguin essen@REDACTED
Tue Jan 22 23:05:33 CET 2013


On 01/22/2013 11:02 PM, Tomas Morstein wrote:
> Dne neděle, 20. ledna 2013 21:16:20 UTC+1 Jachym Holecek napsal(a):
>
>     # Ward Bekker (TTY) 2013-01-20:
>      > I want to connect to the shell on node bar@REDACTED My current
>     solution
>      > (see below) needs some user switch commands. Is there a way using CL
>      > arguments? Couldn't find a mention in the erl man page.
>
>     Yes, using -remsh, like this:
>
>        Terminal 1:
>              # erl -sname foo -setcookie abc
>              Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:4:4]
>     [rq:4] [async-threads:0] [kernel-poll:false]
>
>              Eshell V5.8.5  (abort with ^G)
>
>
> It's worth to note that `remsh' should be used with extra care, especially
> when it comes to connecting live production systems.
> Time by time, it happens (at least to me) that someone accidentally
> issues `q().' instead of ^G-q. The result is remote node shutdown what
> is usually not what we wanted to do, although `q().' is good habit
> otherwise :)
>
> That's why I would recommend you to use extra VM options to restrict
> the shell and block at least `q()' and friends (well, I've never seen
> anybody who accidentally typed `init:stop()' yet :-) ).

init:stop() seems to stop the local node, not the remote node.

> In production, we do it like this: `+Bi -stdlib restricted_shell
> shell_restriction_policy_mod'

Nice advice.

-- 
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu



More information about the erlang-questions mailing list