clash icon indicating copy to clipboard operation
clash copied to clipboard

[Bug] 请问clash放在/opt目录下自启动执行时,下载MMDB是下载在什么路径下呢?

Open wangzy0327 opened this issue 2 years ago • 3 comments

Verify steps

  • [X] 如果你可以自己 debug 并解决的话,提交 PR 吧 Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
  • [X] 我已经在 Issue Tracker 中找过我要提出的问题 I have searched on the issue tracker for a related issue.
  • [X] 我已经使用 dev 分支版本测试过,问题依旧存在 I have tested using the dev branch, and the issue still exists.
  • [X] 我已经仔细看过 Documentation 并无法自行解决问题 I have read the documentation and was unable to solve the issue.
  • [X] 这是 Clash 核心的问题,并非我所使用的 Clash 衍生版本(如 OpenClash、KoolClash 等)的特定问题 This is an issue of the Clash core per se, not to the derivatives of Clash, like OpenClash or KoolClash.

Clash version

1.10.6

What OS are you seeing the problem on?

Linux

Clash config

port: 7890
socks-port: 7891
allow-lan: t

Clash log

[root@centos1272 clash-core]# sudo systemctl status -l clash
● clash.service - clash-core
   Loaded: loaded (/etc/systemd/system/clash.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2022-05-24 03:16:44 EDT; 5min ago
  Process: 98614 ExecStart=/opt/clash-core/clash -f /opt/clash-core/fJ6nfd.yaml (code=exited, status=1/FAILURE)
 Main PID: 98614 (code=exited, status=1/FAILURE)

May 24 03:16:14 centos1272 systemd[1]: Started clash-core.
May 24 03:16:14 centos1272 clash[98614]: time="2022-05-24T03:16:14-04:00" level=info msg="Can't find MMDB, start download"
May 24 03:16:44 centos1272 clash[98614]: time="2022-05-24T03:16:44-04:00" level=fatal msg="Initial configuration directory error: can't initial MMDB: can't d
ownload MMDB: Get \"https://cdn.jsdelivr.net/gh/Dreamacro/maxmind-geoip@release/Country.mmdb\": dial tcp 159.65.107.38:443: i/o timeout"May 24 03:16:44 centos1272 systemd[1]: clash.service: main process exited, code=exited, status=1/FAILURE
May 24 03:16:44 centos1272 systemd[1]: Unit clash.service entered failed state.
May 24 03:16:44 centos1272 systemd[1]: clash.service failed.

Description

手动将MMDB文件拷贝在~/.config/clash/下 启动可以成功,但是自启动的话就去下载MMDB导致失败?请问在opt下自启动的话,需要将MMDB放在什么位置?

wangzy0327 avatar May 24 '22 07:05 wangzy0327

使用 clash -d /path

Dreamacro avatar May 24 '22 08:05 Dreamacro

同问!!!!

zzhjj avatar May 30 '22 18:05 zzhjj

默认路径 ~/.config/clash

如果你的 systemd 以 root 用户启动 clash,则该目录为 /root/.config/clash

https://github.com/Dreamacro/clash/blob/c231fd14666d6ea05d6a75eaba6db69f9eee5ae9/constant/path.go#L9

https://github.com/Dreamacro/clash/blob/c231fd14666d6ea05d6a75eaba6db69f9eee5ae9/constant/path.go#L13-L19

tsln1998 avatar Jun 23 '22 02:06 tsln1998

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Aug 23 '22 02:08 github-actions[bot]