You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by kjduling <gi...@git.apache.org> on 2016/06/07 20:12:40 UTC

[GitHub] incubator-geode pull request #152: GEODE-68: GFSH SYS_HOST_NAME variable sho...

GitHub user kjduling opened a pull request:

    https://github.com/apache/incubator-geode/pull/152

    GEODE-68: GFSH SYS_HOST_NAME variable should report hostname if avail\u2026

    Populate the SYS_HOST_NAME variable with the system host name if possible.  Otherwise, set it to localhost.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kjduling/incubator-geode feature/GEODE-68

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-geode/pull/152.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #152
    
----
commit 32b75112ff51e6dda35635f82bdcf47a6afdaee8
Author: Kevin J. Duling <kd...@pivotal.io>
Date:   2016-06-07T20:06:58Z

    GEODE-68: GFSH SYS_HOST_NAME variable should report hostname if available

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode pull request #152: GEODE-68: GFSH SYS_HOST_NAME variable sho...

Posted by metatype <gi...@git.apache.org>.
Github user metatype commented on a diff in the pull request:

    https://github.com/apache/incubator-geode/pull/152#discussion_r66146482
  
    --- 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 --
    
    @bschuchardt Do we have utility code for doing hostname lookup?  Do you see any problems with timeouts or DNS failures here?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode pull request #152: GEODE-68: GFSH SYS_HOST_NAME variable sho...

Posted by bschuchardt <gi...@git.apache.org>.
Github user bschuchardt commented on a diff in the pull request:

    https://github.com/apache/incubator-geode/pull/152#discussion_r66147139
  
    --- 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 --
    
    Use SocketCreator.getLocalHost() and SocketCreator.getHostName().  SocketCreator caches host names to avoid going to DNS when the host name is already known.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode issue #152: GEODE-68: GFSH SYS_HOST_NAME variable should rep...

Posted by kjduling <gi...@git.apache.org>.
Github user kjduling commented on the issue:

    https://github.com/apache/incubator-geode/pull/152
  
    Resubmitting due to Travis failure.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode pull request #152: GEODE-68: GFSH SYS_HOST_NAME variable sho...

Posted by kjduling <gi...@git.apache.org>.
Github user kjduling closed the pull request at:

    https://github.com/apache/incubator-geode/pull/152


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-geode pull request #152: GEODE-68: GFSH SYS_HOST_NAME variable sho...

Posted by kjduling <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---