bitwalker / bitwalker/distillery

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

Open
#714 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
3k
Forks
398
PR merge metrics
No merged PRs in 30d

Description

### 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 `foo@1.2.3.4`, 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:
```diff
--- 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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.