Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Conversation

@mdaguete
Copy link
Contributor

@mdaguete mdaguete commented Jul 8, 2013

When a node is configured with -sname in app.config or sys.config
the REMSH_NAME_ARG and REMSH_REMSH_ARG arguments are incorrect.

@ghost
Copy link

ghost commented Jul 8, 2013

What if someone uses -sname foo@not_the_hostname? Should we let it crash, require @$(hostname), or parse differently?

@mdaguete
Copy link
Contributor Author

mdaguete commented Jul 8, 2013

Usually I configure '-sname' or '-name' only with name part, but I think that could be better to parse the REMSH_NAME and try to find the '@' to compose the correct arguments and use the hostname -f as default fallback value for '-name' and 'hostname -s' for '-sname' if '@' is not found.

@ghost
Copy link

ghost commented Jul 8, 2013

That sounds reasonable to me.

@mdaguete
Copy link
Contributor Author

What if the remsh node starts in hidden mode (erl -hidden) to avoid other nodes discover it? Is it a good default ? Can I do that in this branch or I create a new one ?

@ghost
Copy link

ghost commented Jul 11, 2013

What if the remsh node starts in hidden mode (erl -hidden) to avoid other nodes discover it? Is it a good default ? Can I do that in this branch or I create a new one ?

Feel free to use this branch, but make a separate commit because it's not related to -sname.

@ghost
Copy link

ghost commented Jul 11, 2013

I don't think hostname -f and hostname -s are portable to all platforms supported by the shell script. At least NetBSD and OpenBSD seem to not support -f and I'm unsure about the Solaris variants.

Relevant info: DragonFlyBSD, FreeBSD, OpenBSD, NetBSD, toybox, BusyBox, OpenSolaris, Mac OS X.

@jaredmorrow, @jj1bdx, @olgeni?

@jaredmorrow
Copy link
Contributor

hostname on Solaris 10 and 11 do not support flags to hostname at all. A call to hostname -f would try to set the hostname to "-f" which might not be desired.

This also applies to OpenSolaris, SmartOS and OmniOS

This does work on FreeBSD and OSX.

@mdaguete
Copy link
Contributor Author

I've updated the 'Incorrect REMSH' commit, now it tries to guess if hostname returns the fqdn name. If node type is -name nodeid instead of -name [email protected] and hostname isn't fqdn warns user and exits.

@ghost
Copy link

ghost commented Jul 19, 2013

I've updated the 'Incorrect REMSH' commit, now it tries to guess if hostname returns the fqdn name. If node type is -name nodeid instead of -name [email protected] and hostname isn't fqdn warns user and exits.

Thanks, can you wrap the long error message below 80 chars? Otherwise, this looks like a reasonable fix for the portability issues to me.

mdaguete added 2 commits July 19, 2013 17:29
When a node is configured with -sname in app.config or sys.config the
REMSH_NAME_ARG and REMSH_REMSH_ARG arguments are incorrect due the
assumption that the node name always contains '@'.

To fix the bug, the script tries to find '@' and then compose the
arguments acording to node name type. If in long name mode the
script can't compose a correct node name exits with warning.
To avoid problems with REMSH node being visible from another nodes
starts it in hidden mode (erl -hidden).
@mdaguete
Copy link
Contributor Author

Wrapped !!! Regards.

@ghost
Copy link

ghost commented Jul 19, 2013

Thanks.

@ghost
Copy link

ghost commented Jul 26, 2013

Just FYI, hostname in a future NetBSD release will support -f: http://mail-index.netbsd.org/source-changes/2013/07/19/msg045587.html.

Vagabond added a commit that referenced this pull request Mar 5, 2014
Incorrect REMSH args when sname is used.
@Vagabond Vagabond merged commit 17fe5d6 into rebar:master Mar 5, 2014
@mdaguete mdaguete deleted the simplenode.runner-remsh-fixes branch April 15, 2014 20:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants