From af529a8b0f691c6e2d236ce464dcf21a71cdb90c Mon Sep 17 00:00:00 2001 From: islam Date: Fri, 28 Aug 2026 05:52:54 +0300 Subject: [PATCH 1/2] Restart crash-watch after updates pacman replaces the script while bash still holds the unlinked inode, so the next toast uses the new helper with the old argv. Fixes #8613 --- bin/omarchy-update-restart | 5 +++++ test/shell.d/crash-capture-test.sh | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/bin/omarchy-update-restart b/bin/omarchy-update-restart index 05f7ba056ec4..f63880474310 100755 --- a/bin/omarchy-update-restart +++ b/bin/omarchy-update-restart @@ -49,3 +49,8 @@ done echo -e "\e[32m\nRestarting shell\e[0m" echo "All plugins have been reloaded" omarchy-restart-shell || true + +# bash holds a running crash-watch on the unlinked inode after pacman +# replaces the script, so the next toast calls the new notification +# helper with the old argv. try-restart is a no-op if it isn't running. +systemctl --user try-restart omarchy-crash-watch.service >/dev/null 2>&1 || true diff --git a/test/shell.d/crash-capture-test.sh b/test/shell.d/crash-capture-test.sh index 1b7e93d05e27..a10e00d1237c 100755 --- a/test/shell.d/crash-capture-test.sh +++ b/test/shell.d/crash-capture-test.sh @@ -54,6 +54,10 @@ grep -F 'omarchy-crash-watch.service' "$ROOT/install/user/first-run/enable-user- fail "crash capture is no longer on by default for new installs" pass "crash capture is on by default" +grep -F 'try-restart omarchy-crash-watch.service' "$ROOT/bin/omarchy-update-restart" >/dev/null || + fail "updates leave the running watcher on the unlinked inode after pacman replaces it" +pass "updates restart the crash watcher" + require_command jq # The per-program mute, driven through the real watcher with a stubbed journal: From 9f86c06ff7055d7a3e36794729bee4bc5b736021 Mon Sep 17 00:00:00 2001 From: Omarchybot <317366263+omarchybot@users.noreply.github.com> Date: Thu, 1 Oct 2026 14:50:50 +0200 Subject: [PATCH 2/2] Stub systemctl in the restart phase test The services phase now runs systemctl --user try-restart, and without a stand-in the test restarted the crash watcher of whoever ran the suite. The stub also pins the restart to the services phase. Co-Authored-By: Claude Opus 5.5 --- test/shell.d/update-restart-phases-test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/shell.d/update-restart-phases-test.sh b/test/shell.d/update-restart-phases-test.sh index baddde914898..07bc607f08af 100755 --- a/test/shell.d/update-restart-phases-test.sh +++ b/test/shell.d/update-restart-phases-test.sh @@ -6,7 +6,7 @@ source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" source "$SHELL_TEST_DIR/fixtures/sudo-boundary-test.sh" rm "$SUDO_TEST_ROOT/bin/omarchy-update-restart" copy_boundary_file bin/omarchy-update-restart -for step in omarchy-state omarchy-restart-sshd omarchy-restart-shell omarchy-system-reboot; do +for step in omarchy-state omarchy-restart-sshd omarchy-restart-shell omarchy-system-reboot systemctl; do ln -s test-step "$SUDO_TEST_ROOT/bin/$step" done cat >"$SUDO_TEST_ROOT/bin/gum" <<'STUB' @@ -24,10 +24,11 @@ for mode in --services-only --reboot-only; do if [[ $mode == "--services-only" ]]; then grep -q '^step:omarchy-restart-sshd ' "$SUDO_TEST_LOG" || fail "service phase did not restart a marked service" grep -q '^step:omarchy-restart-shell ' "$SUDO_TEST_LOG" || fail "service phase did not restart the shell" + grep -q '^step:systemctl --user try-restart omarchy-crash-watch.service$' "$SUDO_TEST_LOG" || fail "service phase left the crash watcher running the replaced script" if grep -q '^prompt:' "$SUDO_TEST_LOG"; then fail "service phase offered a reboot before update cleanup"; fi else grep -q '^prompt:' "$SUDO_TEST_LOG" || fail "reboot phase did not offer the required reboot" - if grep -q '^step:omarchy-restart-' "$SUDO_TEST_LOG"; then fail "reboot phase performed later service work"; fi + if grep -Eq '^step:(omarchy-restart-|systemctl )' "$SUDO_TEST_LOG"; then fail "reboot phase performed later service work"; fi fi pass "restart $mode performs only its selected phase" done