Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appending sname/name with hostname is not in sync with Erlang #714

Open
lukyanov opened this issue Oct 14, 2019 · 0 comments
Open

Appending sname/name with hostname is not in sync with Erlang #714

lukyanov opened this issue Oct 14, 2019 · 0 comments

Comments

@lukyanov
Copy link

Steps to reproduce

  1. Set -name in vm.args as foo (without @).
  2. Build the release.

Description of issue

The issue is this. Erlang relies on a fully qualified host name when appending the node name.
Distillery, however, relies on $HOSTNAME to do the same. This may result to situations when commands like remote_console won't work. The example of such a situation would be a host with no DNS name setup: Erlang translates foo to [email protected], but distillery - to foo@hostname.

The expected result would be to use the same appending mechanism that Erlang does. Erlang seems to rely on what the command hostname -f returns.

Suggested fix:

--- a/priv/libexec/helpers.sh
+++ b/priv/libexec/helpers.sh
@@ -48,7 +48,7 @@ gen_nodename() {
 get_hostname() {
     host="$(echo "${NAME}" | cut -d'@' -f2 -s)"
     if [ -z "$host" ]; then
-        echo "${HOSTNAME}"
+        /bin/hostname -f
     else
         echo "$host"
     fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant