[erlang-questions] Escript and hidden nodes
Fri Dec 7 09:46:44 CET 2007
I don't know how much my recommendation is worth in
this regard, as I don't speak for OTP, and haven't tried this,
but from looking at the source, I'd definitely
use net_kernel:hidden_connect_node(Node), since it
corresponds to connect_node(Node), which /is/
hidden_connect/1 is called through BIFs, according to the
comments, so I'd stay away from that one, and apologies
for firing off my previous mail too quickly. (:
2007/12/7, Lev Walkin <vlm@REDACTED>:
> Ulf, there's no net_kernel:hidden_connect() in the
> net_kernel manual page. Moreover, the source code
> lists hidden_connect() and hidden_connect_node()
> as two possible variants, both exported. Which
> one do you recommend?
> Ulf Wiger wrote:
> > Not having tried, I would guess you should use
> > net_kernel:hidden_connect(Node) instead of using rpc:call()
> > set up the connection automatically.
> > BR,
> > Ulf W
> > 2007/12/7, Lev Walkin <vlm@REDACTED>:
> >> Hi,
> >> erl has an option flag -hidden:
> >> Hidden nodes always establish hidden con-
> >> nections to all other nodes except for nodes in the same global
> >> group. Hidden connections are not published on neither of the
> >> connected nodes, i.e. neither of the connected nodes are part of
> >> the result from nodes/0 on the other node.
> >> I have a maintenance code which is getting run through escript:
> >> #!/usr/local/bin/escript
> >> main(_) ->
> >> net_kernel:start(['code-update', shortnames]),
> >> Node = ...
> >> rpc:call(Node, code, purge, [...]).
> >> Hovewer, this code causes the remote node to be aware of this
> >> maintenance script since it is getting reflected in its nodes()
> >> output. Moreover, the remote node receiving these maintenance
> >> operations attempts to create a back-channel to this maintenance
> >> script node, which is undesirable since maintenance script
> >> might be running on a private NAT'd network and can't receive
> >> backwards connection from a maintained system.
> >> My question is how to enable hidden operation of such maintenance
> >> scripts, either through a command line option to escript or
> >> some magic parameter to net_kernel:start()?
> >> --
> >> Lev Walkin
> >> vlm@REDACTED
> >> _______________________________________________
> >> erlang-questions mailing list
> >> erlang-questions@REDACTED
> >> http://www.erlang.org/mailman/listinfo/erlang-questions
More information about the erlang-questions