Github user kjduling commented on a diff in the pull request:
https://github.com/apache/incubator-geode/pull/152#discussion_r66156949
--- Diff:
geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/shell/Gfsh.java
---
@@ -279,7 +281,12 @@ protected Gfsh(boolean launchShell, String[] args,
GfshConfig gfshConfig) throws
private void initializeEnvironment() {
env.put(ENV_SYS_USER, System.getProperty("user.name"));
env.put(ENV_SYS_USER_HOME, System.getProperty("user.home"));
- env.put(ENV_SYS_HOST_NAME, System.getProperty("user.name"));
+ try {
+ env.put(ENV_SYS_HOST_NAME,
InetAddress.getLocalHost().getHostName());
--- End diff --
I think we might need to back up and define exactly what is meant by
hostname. Are we talking about the name of the machine or the DNS value for a
specific NIC?
For example,
If I run the 'hostname' command from the terminal, I get one name for my
system.
If I run the java code above, I receive the same name. This is equivalent
to calling the C lib gethostname(3).
If I run this with the suggested call, I receive the name of my en4
interface, or my 'default', which is not the same value.
Which is the expected behavior? The name of the machine or the name of the
NIC on the default route?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---