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

Grabbing hostname by running a node may not be needed anymore #811

Open
tsloughter opened this issue Aug 17, 2020 · 0 comments
Open

Grabbing hostname by running a node may not be needed anymore #811

tsloughter opened this issue Aug 17, 2020 · 0 comments

Comments

@tsloughter
Copy link
Member

To work around an issue with resolving the hostname being different depending on if you were running a new node or a remote shell we have this code

# This will fail when creating remote shell

# User can specify an sname without @hostname
# This will fail when creating remote shell
# So here we check for @ and add @hostname if missing
case "${NAME}" in
    *@*) ;;                             # Nothing to do
    *)   NAME=${NAME}@$(relx_get_nodename);;  # Add @hostname
esac

The issue may have been fixed in Erlang as now this works:

$ erl -sname a -setcookie a

(a@rosa) 1>
$ erl -remsh a -sname b -setcookie a

(a@rosa)1>

I think it used to not work but would want to confirm and find the patch to OTP that fixed it before starting down the path of removing it (once the oldest supported version works).

Seems it also works for longnames now:

$ erl -name a -setcookie a                                                           ─╯

([email protected])1>
$ erl -remsh a -name b -setcookie a                                                  ─╯

([email protected])1>
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