Files
clearpilot/launch_openpilot.sh
T
brianhansonxyz 54c566c68f kill stale text-error window by comm too, not just path
selfdrive/ui/text is a shell wrapper that execs ./_text. After exec,
the running process's argv has no path component, so
pkill -f 'selfdrive/ui/text' silently misses it. Add pkill -x _text
alongside the existing path-pattern kills in build_only.sh,
launch_openpilot.sh, and launch_chffrplus.sh.
2026-05-03 22:28:33 -05:00

42 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/bash
# Kill other instances of this script, launch chain, and all managed processes
for pid in $(pgrep -f 'launch_openpilot.sh' | grep -v $$); do
kill -9 "$pid" 2>/dev/null
done
for pid in $(pgrep -f 'launch_chffrplus.sh' | grep -v $$); do
kill -9 "$pid" 2>/dev/null
done
pkill -9 -f 'python.*manager.py' 2>/dev/null
# Kill all processes started by the manager (run as comma user, in openpilot tree)
pkill -9 -f 'selfdrive\.' 2>/dev/null
pkill -9 -f 'system\.' 2>/dev/null
pkill -9 -f './ui' 2>/dev/null
pkill -9 -f 'selfdrive/ui/text' 2>/dev/null
# `text` is a shell wrapper that execs `./_text` — after exec the running
# process's argv has no path, so kill by exact comm too.
pkill -9 -x _text 2>/dev/null
sleep 1
# CLEARPILOT: ensure params persistence dir is owned by comma:comma. Editing
# the tree as root leaves files owned by root in /data/params/d_tmp/, and
# Params writes done as comma will then EACCES on rename. Reset on every
# launch so this never silently breaks again.
sudo chown -R comma:comma /data/params
bash /data/openpilot/system/clearpilot/on_start.sh
# CLEARPILOT: start VPN monitor (kills previous instances, runs as root)
sudo bash -c 'nohup /data/openpilot/system/clearpilot/vpn-monitor.sh >> /tmp/vpn-monitor.log 2>&1 &'
# CLEARPILOT: start nice monitor (keeps claude at nice 19)
sudo bash -c 'nohup /data/openpilot/system/clearpilot/nice-monitor.sh > /dev/null 2>&1 &'
# CLEARPILOT: pass --bench flag through to manager via env var
if [ "$1" = "--bench" ]; then
export BENCH_MODE=1
fi
cd /data/openpilot
exec ./launch_chffrplus.sh