Unexpected short name and net_adm:localhost() differences #8694
Labels
bug
Issue is reported as a bug
help wanted
Issue not worked on by OTP; help wanted from the community
team:VM
Assigned to OTP team VM
Describe the bug
The local host name used for the node when
-sname
is set does not always match whatnet_adm:localhost()
returns, whennet_adm:localhost()
returns a short name.To Reproduce
In all cases
/etc/hostname
containszen
.1 When
/etc/hosts
contains:I get
2 When
/etc/hosts
contains:I get the correct, but unconvenient:
3 When
/etc/hosts
contains:I get:
4 Finally, only in the following case where
/etc/hosts
contains:I get the same name in both places:
5 Bonus, when
/etc/hosts
contains:I also get the correct:
Expected behavior
I expect
-sname
to usezen
instead oflocalhost
whennet_adm:localhost()
returns"zen"
. I expect-sname
to uselocalhost
only whennet_adm:localhost()
also returns"localhost"
.I do not necessarily expect the hosts to match when
net_adm:localhost()
returns"zen.localdomain"
. That one is understandable since-sname
uses a short name. In that case I expect-sname
to be set tozen
(which it already is as seen in the second snippet). It would be more convenient ifnet_adm:localhost()
would return the same value though, when the short name is also configured and/or reachable.The local host resolution algorithms should agree when possible.
Affected versions
At least OTP 26 and 27.
Additional context
This breaks
slave
as that module usesremsh
only if the host isn't local and because the hosts don't match it thinks it's not local. I know this module is deprecated.The text was updated successfully, but these errors were encountered: