Clipboard sync: a process gone since pgrep no longer aborts the switch

ps fails for it, and with pipefail the assignment ended the activation;
it is skipped now.
This commit is contained in:
Pierre Kisters committed 2026-10-01 04:09:13 +02:00
1 parent ae8686e284
commit 464099c1cd
1 file changed
+2 -1
+2 -1
View File
@@ -54,7 +54,8 @@ in {
desktop=() other=()
for pid in $(${pkgs.procps}/bin/pgrep -x clipboard-sync || true); do
# clipboard-sync forks workers; only look at top-level instances.
ppid="$(${pkgs.procps}/bin/ps -o ppid= -p "$pid" | tr -d ' ')"
# Gone since pgrep (e.g. an exited worker): skip it.
ppid="$(${pkgs.procps}/bin/ps -o ppid= -p "$pid" | tr -d ' ')" || continue
[ "$(cat "/proc/$ppid/comm" 2>/dev/null)" = clipboard-sync ] && continue
if [ "$(readlink "/proc/$pid/exe" 2>/dev/null)" != "$want" ]; then
run kill "$pid" || true # stale build