Skip to content

install_hermes_memory_tencentdb.sh 在 Hermes root/FHS 安装下误判未安装 #18

@kylezhang

Description

@kylezhang

我在一台 Ubuntu 服务器上把 Hermes 和 TencentDB Agent Memory 接起来时,遇到一个路径兼容问题。最后已经绕过去并跑通了,但这里应该可以在安装脚本里兼容一下。

环境

  • Ubuntu 服务器
  • 当前用户:root
  • Hermes 通过官方安装脚本安装
  • Hermes gateway 选择 system service,配置为 root 用户运行

Hermes 当前 root + Linux 新安装时会采用 FHS 布局:

代码目录:/usr/local/lib/hermes-agent
数据目录:/root/.hermes

现象

执行:

bash install_hermes_memory_tencentdb.sh

会报:

[ERROR] Hermes agent not found at /root/.hermes/hermes-agent
[ERROR] Please run install_hermes_ubuntu.sh first.

但实际上 Hermes 已经安装完成,并且 hermes-gateway.service 可以正常启动。

原因

脚本里固定用了:

HERMES_HOME="$USER_HOME/.hermes"
HERMES_AGENT_DIR="$HERMES_HOME/hermes-agent"

这对非 root 或旧布局是成立的,但对当前 Hermes root/FHS 布局不成立。

我临时通过软链接绕过了:

ln -sfn /usr/local/lib/hermes-agent /root/.hermes/hermes-agent

建议

HERMES_AGENT_DIR 可以按顺序兼容几种位置:

  1. 用户显式传入的 HERMES_AGENT_DIR
  2. $HERMES_HOME/hermes-agent
  3. /usr/local/lib/hermes-agent

这样既不影响旧安装,也能兼容 Hermes 当前 root/FHS 安装方式。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions