Spark icon indicating copy to clipboard operation
Spark copied to clipboard

在Linux中使用service进行后台建立报连接错误

Open jixishi opened this issue 6 months ago • 0 comments

Please make sure of the following things.

  • [ ] I have read the documentation.
  • [x] 我已阅读 文档
  • [ ] I'm sure there are no duplicate issues.
  • [x] 我确定没有提交和他人重复的issue。
  • [ ] I'm sure it's due to Spark itself and not my operational issue or something else.
  • [x] 我确定问题由Spark自身引起,不是我自己的操作失误或其他问题。

Version / 版本

v0.2.1

Describe the bug / 问题描述

在Linux中使用service进行后台建立报连接错误 同时使用同样的可执行文件在终端执行时不会报错web中也可看见设备接入

Reproduction / 复现方式

服务配置

[Unit]
Description=agent-linux Service
After=network.target

[Service]
ExecStart=/usr/local/bin/agent-linux
Restart=always
RestartSec=3
User=root

[Install]
WantedBy=multi-user.target

Logs / 日志

Jul 09 18:53:17 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:17 Connection error: websocket: bad handshake
Jul 09 18:53:21 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:21 Connection error: websocket: bad handshake
Jul 09 18:53:24 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:24 Connection error: websocket: bad handshake
Jul 09 18:53:27 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:27 Connection error: websocket: bad handshake
Jul 09 18:53:30 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:30 Connection error: websocket: bad handshake
Jul 09 18:53:34 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:34 Connection error: websocket: bad handshake
Jul 09 18:53:37 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:37 Connection error: websocket: bad handshake
Jul 09 18:53:40 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:40 Connection error: websocket: bad handshake
Jul 09 18:53:44 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:44 Connection error: websocket: bad handshake
Jul 09 18:53:47 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:47 Connection error: websocket: bad handshake
Jul 09 18:53:50 gid410av.kuxueyun.com agent-linux[16023]: [ERRO] 2025/07/09 18:53:50 Connection error: websocket: bad handshake

Additional information / 附加说明

终端执行同样的文件 Image

Image

jixishi avatar Jul 09 '25 11:07 jixishi