Skip to content

以nobody 用户启动时 user.home目录为/的情况启动失败 #572

Closed
@chenshun00

Description

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: 3.1.0
  • 目标进程的JVM版本: 1.8
  • 执行arthas-boot的版本: 1.7
$ java -jar arthas-boot.jar
[INFO] arthas-boot version: 3.1.0
[INFO] Found existing java process, please choose one and hit RETURN.
* [1]: 686 org.apache.catalina.startup.Bootstrap
  [2]: 18232 org.apache.catalina.startup.Bootstrap
  [3]: 25596 org.apache.catalina.startup.Bootstrap
   .....
  [18]: 8043 org.springframework.boot.loader.PropertiesLauncher

选择18

18
[ERROR] cannot create directory /.arthas/lib: maybe permission denied
[nobody@aliyun-app-168-151 logs]$

直接去根目录 / 了,肯定没有权限。询问arthas commit,是使用user.home 创建的文件夹,加上 -Duser.home=/home/xxxxx 启动成功.

查看真实的 user.home

public class AAA {
    public static void main(String[] args) {
        System.out.println(System.getProperty("user.home"));
        System.out.println(System.getProperty("user.name"));
        System.out.println(System.getProperty("user.dir"));
    }
}
javac AAA.java
[nobody@aliyun-app-xxxx-xxx] logs]$ java AAA
nobody
/
/path/tomcat/logs

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions