distillery
distillery copied to clipboard
Appending sname/name with hostname is not in sync with Erlang
Steps to reproduce
- Set
-nameinvm.argsasfoo(without@). - 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