#!/bin/bash # Launch the observer daemon. Run from WSL: bash launch_daemon.sh cd /mnt/d/resonance-engine-active # Kill any existing daemons PIDS=$(ps aux | awk '/khra_gixx_1024/ && !/awk/{print $2}') if [ -n "$PIDS" ]; then echo "Killing stale daemons: $PIDS" kill -9 $PIDS 2>/dev/null sleep 2 fi # Verify ports free if ss -tlnp 2>/dev/null | grep -qE '555[6-9]|556[01]'; then echo "ERROR: ports still in use — manual cleanup needed" ss -tlnp | grep -E '555[6-9]|556[01]' exit 1 fi # Start fresh telemetry > telemetry.jsonl # Launch detached with log nohup ./build/khra_gixx_1024_v5_observer > observer_daemon.log 2>&1 & sleep 4 # Verify it started pgrep -f khra_gixx_1024 > /dev/null && echo "LAUNCH OK" || echo "LAUNCH FAILED"