xray启动状态错误
[root@iZj6c3w6x7zccrjtzelfr8Z ~]# systemctl status xray
● xray.service - Xray Service
Loaded: loaded (/etc/systemd/system/xray.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/xray.service.d
└─10-donot_touch_single_conf.conf
Active: failed (Result: exit-code) since 二 2024-08-20 13:48:30 CST; 17s ago
Docs: https://github.com/xtls
Process: 7027 ExecStart=/usr/local/bin/xray run -config /usr/local/etc/xray/config.json (code=exited, status=23)
Main PID: 7027 (code=exited, status=23)
排错思路
使用journalctl -u xray.service -b --no-pager -n 50
查看xray日志,也显示错误码23
错误码报错 23 不出意外为配置文件存在问题
进入配置文件路径下 /usr/local/etc/xray ,将配置文件下载进本机编译软件(例如vscode)方便检查
下载好的配置文件发现有括号和路径错误,修改后重新上传进服务器配置文件路径 —— 在此排除配置文件格式问题
需要改动的内容为:
- “access”、"error"日志路径
- id ——改为 xray uuid 生成的 uuid
- 邮箱(可选)
上传回服务器后启动依然报错23,已确定不是配置文件json格式错误,那么有可能是路径找不到,