fix: browser wrapper permanent pour SingletonLock après redémarrage
- chrome-wrapper.sh : nettoie les lock files avant de lancer Chrome - openclaw.json : executablePath pointe vers le wrapper - start-chrome-cdp.sh : script de secours manuel - oc-up.sh : mis à jour (plus de démarrage manuel Chrome nécessaire) - MEMORY.md : documentation du fix
This commit is contained in:
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
# Démarre Chrome en mode CDP pour OpenClaw browser control
|
||||
# Appelé par oc-up.sh depuis l'hôte Docker, ou manuellement
|
||||
|
||||
CHROME="/home/node/.cache/ms-playwright/chromium-1208/chrome-linux64/chrome"
|
||||
PROFILE="/home/node/.openclaw/browser/openclaw/user-data"
|
||||
CDP_PORT=18800
|
||||
|
||||
# Nettoyer les anciens lock files (issus d'un précédent conteneur)
|
||||
rm -f "$PROFILE/SingletonLock" "$PROFILE/SingletonCookie" "$PROFILE/SingletonSocket"
|
||||
|
||||
# Tuer tout chrome déjà en cours (sécurité)
|
||||
pkill -f "remote-debugging-port=$CDP_PORT" 2>/dev/null || true
|
||||
sleep 1
|
||||
|
||||
# Lancer Chrome en arrière-plan
|
||||
mkdir -p "$PROFILE"
|
||||
"$CHROME" \
|
||||
--headless \
|
||||
--no-sandbox \
|
||||
--disable-gpu \
|
||||
--disable-dev-shm-usage \
|
||||
--remote-debugging-port=$CDP_PORT \
|
||||
--user-data-dir="$PROFILE" \
|
||||
about:blank \
|
||||
> /tmp/chrome-cdp.log 2>&1 &
|
||||
|
||||
echo "Chrome CDP lancé (PID $!), attente..."
|
||||
sleep 3
|
||||
|
||||
# Vérifier que CDP répond
|
||||
if curl -sf http://127.0.0.1:$CDP_PORT/json/version > /dev/null 2>&1; then
|
||||
echo "✅ Chrome CDP opérationnel sur le port $CDP_PORT"
|
||||
else
|
||||
echo "❌ Chrome CDP ne répond pas — voir /tmp/chrome-cdp.log"
|
||||
cat /tmp/chrome-cdp.log 2>/dev/null | tail -10
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user