[erlang-questions] what *exactly* are sname and name ?

Ulf Wiger ulf@REDACTED
Sat Dec 9 22:02:05 CET 2006

Den 2006-12-09 19:45:54 skrev Joe Armstrong <erlang@REDACTED>:

> On 12/9/06, Ulf Wiger <ulf@REDACTED> wrote:
>> Just to point out the obvious, this is what the 'erl' man page says  
>> about
>> -name and -sname:
> Well it's not obvious to me....

With 'obvious', I meant the fact that options to the 'erl'
command are documented in the man page for 'erl'. If not
obvious, it does have some logic to it. ;-)

> What on earth does this mean - I've read this several
> times and I don't understand it.
> "the host name portion of the node name Name@REDACTED
> will be the short name, not fully qualified."

If your hostname is aaa.bbb.ccc.com, the shortname is usually aaa.

> What does this mean????
> What It might mean might be the following (at least this would be
> logical, but it would mean that the syntactic form of Name in the two
> comands was different)
>    erl -name abc@REDACTED
>        makes a node with name abc@REDACTED

Well, possibly (I don't have erlang installed on this particular machine),  
but the normal usage is

erl -name abc

  makes a node with name abc@REDACTED

>    erl -sname foo
>      when my host name is aaa.bbb.ccc.com
>      would create  a node called foo@REDACTED

No, it would create a node called foo@REDACTED

where aaa is the short name version of aaa.bbb.ccc.com

> If this were the case then I see no reason why
> the node started with name would not be able to
> talk to the node started with sname ..

I believe the longnames() option is used to determine the method of  
resolving node names,  but someone else can surely give you much more  
detail here.

>     When I do erl -sname foo on my machine (with hostname msi)
> erlang says my node is called:
> (foo@REDACTED) >
> (ie not foo@REDACTED) ....
>    Goodness knows why

What does 'hostname' return on that machine?

localhost is a valid alias, so that might be a fallback if the hostname  
hasn't been properly set.

Ulf W
Ulf Wiger

More information about the erlang-questions mailing list