From 54c566c68fdf9731bfc6544790fbb674a46cd07f Mon Sep 17 00:00:00 2001 From: Brian Hanson Date: Sun, 3 May 2026 22:28:33 -0500 Subject: [PATCH] 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. --- build_only.sh | 5 ++++- launch_chffrplus.sh | 5 ++++- launch_openpilot.sh | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build_only.sh b/build_only.sh index 139c541..12bfe30 100755 --- a/build_only.sh +++ b/build_only.sh @@ -10,8 +10,11 @@ BASEDIR="/data/openpilot" # Fix ownership — we edit as root, openpilot builds/runs as comma sudo chown -R comma:comma "$BASEDIR" -# Kill stale error displays and any running manager/launch/managed processes +# Kill stale error displays and any running manager/launch/managed processes. +# `text` is a shell wrapper that execs `./_text` — after exec the process is named +# `_text` (no path), so we kill by exact comm in addition to the path pattern. pkill -9 -f "selfdrive/ui/text" 2>/dev/null +pkill -9 -x _text 2>/dev/null pkill -9 -f 'launch_openpilot.sh' 2>/dev/null pkill -9 -f 'launch_chffrplus.sh' 2>/dev/null pkill -9 -f 'python.*manager.py' 2>/dev/null diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 1b3cb15..24a9384 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -79,8 +79,11 @@ function launch { agnos_init fi - # CLEARPILOT: kill stale error display from previous build/run + # CLEARPILOT: kill stale error display from previous build/run. + # `text` is a wrapper that execs ./_text — running process is named _text + # with no path, so kill by exact comm too. pkill -f "selfdrive/ui/text" 2>/dev/null + pkill -x _text 2>/dev/null # write tmux scrollback to a file tmux capture-pane -pq -S-1000 > /tmp/launch_log diff --git a/launch_openpilot.sh b/launch_openpilot.sh index 4a0ac56..5ab52c3 100755 --- a/launch_openpilot.sh +++ b/launch_openpilot.sh @@ -13,6 +13,9 @@ 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