fix(chv): 阶段 2 syncd 写路径改到 chv 所有的 /run/chv/syncd/ 子目录
/run/chv 是 0755 root:root,chv 身份的 syncd 写不进状态文件 与 socket,_atomic_write 抛错致进程反复退出、systemctl 长期 activating(2026-11-07 真机实测)。socket 与状态文件改到 tmpfiles 预建的 /run/chv/syncd/(0755 chv:chv,与 chv-browser 的 shots 同款);daemon 的 sync 摘要读同一路径;驱动的 syncd socket 路径与 ls 检查同步更新;另修驱动 SSH poller 线程残留(daemon=True + wake 失败也 set 事件)。
This commit is contained in:
1 parent
9d77ae55a7
commit
8013431f63
4 files changed
+23
-4
No files matched your search
+1
-1
@@ -319,7 +319,7 @@ VC_ARGS=(-a "$OUT/disk.raw"
|
||||
--run-command 'printf "[Unit]\nDescription=CHV guest runtime daemon (stage 2: heartbeat/resources/snapshot)\nAfter=network.target\n\n[Service]\nType=simple\nExecStart=/usr/bin/python3 /usr/local/bin/chv-daemon\nRestart=always\nRestartSec=2\n\n[Install]\nWantedBy=multi-user.target\n" > /etc/systemd/system/chv-daemon.service'
|
||||
--run-command 'printf "[Unit]\nDescription=CHV guest exec daemon (stage 2: shell/files/codex hosting)\nAfter=network.target\n\n[Service]\nType=simple\nExecStart=/usr/bin/python3 /usr/local/bin/chv-execd\nRestart=always\nRestartSec=2\n\n[Install]\nWantedBy=multi-user.target\n" > /etc/systemd/system/chv-execd.service'
|
||||
--run-command 'printf "[Unit]\nDescription=CHV Gitea sync daemon (stage 2: resident pull/push loop)\nAfter=network.target\n\n[Service]\nType=simple\nUser=chv\nGroup=chv\nExecStart=/usr/bin/python3 /usr/local/bin/chv-syncd\nRestart=always\nRestartSec=2\n\n[Install]\nWantedBy=multi-user.target\n" > /etc/systemd/system/chv-syncd.service'
|
||||
--run-command 'printf "d /run/chv 0755 root root -\nd /run/chv/shots 0755 chv-browser chv-browser -\nd /run/chv/tasks 0755 root root -\n" > /etc/tmpfiles.d/chv.conf && systemctl enable chv-broker chv-browser chv-daemon chv-execd chv-syncd || true')
|
||||
--run-command 'printf "d /run/chv 0755 root root -\nd /run/chv/shots 0755 chv-browser chv-browser -\nd /run/chv/tasks 0755 root root -\nd /run/chv/syncd 0755 chv chv -\n" > /etc/tmpfiles.d/chv.conf && systemctl enable chv-broker chv-browser chv-daemon chv-execd chv-syncd || true')
|
||||
# P1 交接(Muse P1 的 vsock_notify.py):文件在仓库里存在时拷入
|
||||
# 镜像(P1 分支才有,本分支尚无);不存在时只警告、不失败——
|
||||
# 合并后自动生效,P2 不改该脚本内容。
|
||||
|
||||
@@ -41,7 +41,11 @@ DAEMON_SOCK = "/run/chv/daemon.sock"
|
||||
SNAPSHOT_READY_PATH = "/run/chv/snapshot-ready.json"
|
||||
EXECD_SOCK = "/run/chv/execd.sock"
|
||||
EXECD_TASKS = "/run/chv/execd-tasks.json"
|
||||
SYNC_STATUS = "/run/chv/sync-status.json"
|
||||
# syncd 的状态文件在它自己的 chv 所有子目录里(见 build.sh
|
||||
# tmpfiles:/run/chv 本身 0755 root:root,chv 身份的 syncd
|
||||
# 写不进——2026-11-07 真机实测:状态文件写失败致 syncd
|
||||
# 反复退出、systemctl 长期 activating)。
|
||||
SYNC_STATUS = "/run/chv/syncd/sync-status.json"
|
||||
WORKSPACE = "/home/chv/workspace"
|
||||
HEARTBEAT_INTERVAL = 10.0
|
||||
MAX_REQUEST_BYTES = 65536
|
||||
|
||||
@@ -30,8 +30,8 @@ import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
SYNC_SOCK = "/run/chv/syncd.sock"
|
||||
STATUS_PATH = "/run/chv/sync-status.json"
|
||||
SYNC_SOCK = "/run/chv/syncd/syncd.sock"
|
||||
STATUS_PATH = "/run/chv/syncd/sync-status.json"
|
||||
WORKSPACE = "/home/chv/workspace"
|
||||
SYNC_BIN = "/usr/local/bin/chv-sync"
|
||||
DEFAULT_INTERVAL = 300.0
|
||||
|
||||
Reference in new issue
Block a user