#!/usr/bin/env python3 """Recover dylive neko-12 after SIGILL: free mem, patch chrome flags, restart browser, reopen Studio.""" from __future__ import annotations import sys import time import paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace") HOST = "107.173.30.245" PASS = "Xiao4669805" STUDIO = "https://studio.youtube.com/channel/UCfP5vcTQEfrHc13yTmmokQw/livestreaming" def ssh(): c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect( HOST, 22, "root", PASS, timeout=45, allow_agent=False, look_for_keys=False, banner_timeout=120, ) return c def run(c, cmd, t=180): print(f"\n===== {cmd[:90].replace(chr(10),' ')} =====", flush=True) _i, o, e = c.exec_command(cmd, timeout=t) out = (o.read() + e.read()).decode("utf-8", "replace") print(out[-12000:] if len(out) > 12000 else out, flush=True) return o.channel.recv_exit_status(), out c = ssh() # 1) How is browser-launch mounted + drop caches if safe run( c, r""" set +e echo '=== mounts ===' docker inspect douyinweb-neko-12 --format '{{range .Mounts}}{{.Source}} -> {{.Destination}}{{println}}{{end}}' | head -40 echo '=== mem before ===' free -h | head -3 # drop caches (safe) to help chrome restart sync; echo 3 > /proc/sys/vm/drop_caches free -h | head -3 # list heavy processes ps aux --sort=-rss | head -15 """, ) # 2) Patch host-side browser-launch if bind-mounted; also patch inside container as fallback run( c, r""" set -euo pipefail SRC='' for p in \ /opt/douyinWEB/backend/neko/browser-launch.sh \ /opt/douyinWEB/neko/browser-launch.sh do if [ -f "$p" ]; then SRC="$p"; break; fi done echo "SRC=$SRC" if [ -n "$SRC" ]; then cp -a "$SRC" "${SRC}.bak-sigill-$(date +%s)" # Harden js-flags against WASM/AVX512 SIGILL on Studio pages; raise renderer heap a bit python3 - </dev/null || true done docker exec douyinweb-neko-12 sh -c 'find / -name browser-launch.sh 2>/dev/null | head' """, ) c.close() print("PHASE1_DONE")