You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "NOMURA Yoshihide (JIRA)" <ji...@apache.org> on 2008/08/28 11:57:44 UTC

[jira] Issue Comment Edited: (HADOOP-3508) Namenode couldn't execute when the user name contains a space

    [ https://issues.apache.org/jira/browse/HADOOP-3508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626504#action_12626504 ] 

yoshimov edited comment on HADOOP-3508 at 8/28/08 2:56 AM:
-------------------------------------------------------------------

I suggest to use system property to get user name like this:
{code:Java}
  static String getUnixUserName() throws IOException {
	  return System.getProperty("user.name");
  }
{code}
Does this code make sense on Linux too?


      was (Author: yoshimov):
    I suggest to use system property to get user name like this:

  static String getUnixUserName() throws IOException {
	  return System.getProperty("user.name");
  }

Does this code make sense on Linux too?

  
> Namenode couldn't execute when the user name contains a space
> -------------------------------------------------------------
>
>                 Key: HADOOP-3508
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3508
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>    Affects Versions: 0.17.0
>         Environment: Windows XP, Windows 2003 Server
>            Reporter: NOMURA Yoshihide
>
> The Hadoop Namenode couldn't execute as Windows service,
> because UnixUserGroupInformation#getUnixUserName() throws IOException.
> The 'whoami' command output is 'nt authority\system' in default Windows service,
> so I suggest to change the method like follows:
>   static String getUnixUserName() throws IOException {
>     String[] result = executeShellCommand(
>         new String[]{Shell.USER_NAME_COMMAND});
>     if (Shell.WINDOWS) {
>     	return toString(result);
>     } else if (result.length!=1) {
>       throw new IOException("Expect one token as the result of " + 
>           Shell.USER_NAME_COMMAND + ": " + toString(result));
>     }
>     return result[0];
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.