compose: mount /unitree/var/run instead of the socket file; warn when mscli fails

master_service unlinks and recreates master_service.sock on every host boot
or restart, and a bind mount of the file pins the old (dead) inode, so every
mscli call inside the container failed with "Connect to server error".
Mount the directory instead. The entrypoint wraps "mscli stopservice
video_hub_pc4" in stop_videohub(), which prints a WARN when mscli cannot
reach master_service (then /dev/video4 stays busy and the camera will not
open), at start and in the 10 s loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
henrytherobotandClaude Opus 5.5 committed 2026-09-30 17:23:06 +02:00
1 parent 13826adc97
commit 41a894bffb
1 file changed
+15 -3
+15 -3
View File
@@ -37,15 +37,27 @@ services:
# mscli + master_service socket so the container can stop the
# Unitree video_hub_pc4 service (it holds /dev/video4 — the D435i
# V4L2 node — and would otherwise make Open() fail with EBUSY).
# Mount the *directory*, not the socket file: master_service unlinks
# and recreates the socket on every host boot/restart, and a bind
# mount of the file pins the old (now dead) inode, so every mscli
# call inside the container fails with "Connect to server error".
- /unitree/sbin/mscli:/unitree/sbin/mscli:ro
- /unitree/var/run/master_service.sock:/unitree/var/run/master_service.sock
- /unitree/var/run:/unitree/var/run
entrypoint:
- bash
- -c
- |
/unitree/sbin/mscli stopservice video_hub_pc4 >/dev/null 2>&1 || true
stop_videohub() {
out=$$(/unitree/sbin/mscli stopservice video_hub_pc4 2>&1) || true
case "$$out" in
*"Connect to server error"*|*"connect error"*)
echo "[entrypoint] WARN mscli cannot reach master_service.sock:" \
"/dev/video4 will stay busy and the camera will not open. $$out" >&2 ;;
esac
}
stop_videohub
sleep 2
( while sleep 10; do /unitree/sbin/mscli stopservice video_hub_pc4 >/dev/null 2>&1 || true; done ) &
( while sleep 10; do stop_videohub; done ) &
exec /app/entrypoint.sh
env_file: .env
depends_on: