From daf7c70ed394e5336da6a189c3eb01dbf979aaa6 Mon Sep 17 00:00:00 2001 From: Pierre Kisters <1524059+lhns@users.noreply.github.com> Date: Thu, 1 Oct 2026 04:07:12 +0200 Subject: [PATCH] Cleanup: a Firefox profile in use is detected again with other users' processes running ff_in_use piped find into grep -q; with pipefail, find's error on any unreadable /proc//fd (root's processes) made every profile look unused, so cleanup could remove user.js and rewrite prefs.js under a running Firefox. The Nix check's sandbox has no such processes. --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 6c5b614..2c147c4 100755 --- a/install.sh +++ b/install.sh @@ -713,7 +713,9 @@ clean_icons() { # --- Firefox user.js --- ff_keys() { sed -n 's/^[[:space:]]*user_pref(\("[^"]*"\),.*/\1/p' "$1" 2>/dev/null || true; } -ff_in_use() { find /proc/[0-9]*/fd -lname "$1/.parentlock" -print -quit 2>/dev/null | grep -q .; } +# Not `find | grep -q`: find fails on other users' /proc//fd, and with +# pipefail that would make every profile look unused. +ff_in_use() { [[ -n $(find /proc/[0-9]*/fd -lname "$1/.parentlock" -print -quit 2>/dev/null) ]]; } clean_firefox() { # all local all=$1 prof name u t kind keys pats left