From 9e02402555be4b0df0d956beab64eaf96afbc394 Mon Sep 17 00:00:00 2001 From: maksarsanjeev Date: Thu, 8 Oct 2026 01:40:42 +0300 Subject: [PATCH] install.sh: wait for both services before reporting (no false alarm) Co-Authored-By: Claude Opus 5.5 --- scripts/netcore/install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/netcore/install.sh b/scripts/netcore/install.sh index 436f333..6d0f587 100644 --- a/scripts/netcore/install.sh +++ b/scripts/netcore/install.sh @@ -129,9 +129,15 @@ for label in "$CORE_LABEL" "$CTL_LABEL"; do launchctl bootstrap system "/Library/LaunchDaemons/$label.plist" 2>/dev/null || launchctl kickstart -k "system/$label" done +# Services take a moment to start: wait up to 10 s before judging. +running() { + launchctl print "system/$CORE_LABEL" 2>/dev/null | grep -q 'state = running' && + launchctl print "system/$CTL_LABEL" 2>/dev/null | grep -q 'state = running' && + [ -S /var/run/brov-netctl.sock ] +} i=0 -until [ -S /var/run/brov-netctl.sock ] || [ $i -ge 20 ]; do sleep 0.5; i=$((i+1)); done -if launchctl print "system/$CORE_LABEL" | grep -q 'state = running' && [ -S /var/run/brov-netctl.sock ]; then +until running || [ $i -ge 20 ]; do sleep 0.5; i=$((i+1)); done +if running; then echo "✓ Ядро и помощник работают." else echo "⚠ Что-то не поднялось. Логи: /Library/Logs/BroV/"