Skip to content

Restart crash-watch after updates - #8708

Open
Elshayib wants to merge 6 commits into
omacom:quattrofrom
Elshayib:fix/restart-crash-watch-on-update
Open

Elshayib wants to merge 6 commits into
omacom:quattrofrom
Elshayib:fix/restart-crash-watch-on-update

Conversation

@Elshayib

Copy link
Copy Markdown

What: Restart omarchy-crash-watch from omarchy-update-restart after an update.

Why: Fixes #8613. pacman replaces bin/omarchy-crash-watch while the running process still holds the unlinked inode (fd 255). The next journal toast then execs the new omarchy-notification-send with the old argv, so notifications fail.

How: systemctl --user try-restart omarchy-crash-watch.service after the existing shell restart. try-restart is a no-op if the watcher is stopped, so crash-capture-off stays off. Rejected a one-shot migration: it would not cover the next script change. Restarts belong here, not in a migration (same rule as the shell).

Verified:

NOT verified:

  • live systemctl --user try-restart (Windows; no user systemd / Hyprland)
  • full test/shell.d/crash-capture-test.sh (needs jq + journal stubs beyond the new grep)
  • test/all, pacman, omarchy-iso

pacman replaces the script while bash still holds the
unlinked inode, so the next toast uses the new helper
with the old argv.

Fixes omacom#8613
Copilot AI balanced review requested due to automatic review settings August 28, 2026 02:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restarts the crash watcher after updates to prevent version-skew notification failures.

Changes:

  • Adds a best-effort try-restart after shell restart.
  • Adds regression coverage for the restart command.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
bin/omarchy-update-restart Restarts the active crash watcher after updates.
test/shell.d/crash-capture-test.sh Asserts update restart integration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
omarchybot and others added 2 commits October 1, 2026 14:50
quattro split omarchy-update-restart into --services-only and --reboot-only phases. The crash-watch restart goes in the services phase, beside the shell restart: it is service work, and the reboot phase runs after the user hooks with nothing left to restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on a worker built from the Omarchy ISO. The fix holds, and I pushed two commits so it merges into quattro again.

What changed on your branch. Since you opened this, quattro split omarchy-update-restart into a --services-only phase (run straight after the package transaction) and a --reboot-only phase (run at the very end), which is why the branch stopped merging cleanly. d885d1a merges quattro in and puts your try-restart line in the services phase, beside the shell restart, so it runs right after pacman has replaced the script. 9f86c06 stubs systemctl in test/shell.d/update-restart-phases-test.sh: once the services phase ran systemctl --user try-restart, that test restarted the real crash watcher of whoever ran the suite. The stub also checks that the restart happens in the services phase and not the reboot phase. Your commit is unchanged.

Reproduction. On the worker I restarted the watcher and replaced /usr/bin/omarchy-crash-watch the way pacman does (write a new file, rename it over the old one), which leaves the running process on /usr/bin/omarchy-crash-watch (deleted). Then I ran omarchy-update-restart --services-only:

  • quattro: same PID, still on the deleted inode. Fails.
  • This head (9f86c06): new PID, on the installed script. Passes.
  • This head with the try-restart line removed: same PID, still on the deleted inode. Fails.

With the watcher stopped, as omarchy-toggle-crash-capture leaves it, it stays stopped after the update-restart, so crash capture that was turned off stays off.

Tests on the worker. crash-capture-test.sh, update-restart-phases-test.sh, update-sequence-test.sh, update-hook-security-test.sh, update-lock-test.sh and update-disk-space-test.sh all pass. update-restart-phases-test.sh fails when the fix is removed. ./test/cli has one failure, "vscode generated theme references current theme file", and quattro fails it the same way on the same worker, so it is not from this change. I did not run the full shell suite.

Review. Reviewed by Claude Opus 5.5. The second opinion (Codex Medium) did not run: it answered a ping, but omabot's daily review budget was spent before it could look at this. No other model has checked this change. No other open pull request touches #8613.

The change is proportionate: one line in the place that already restarts the shell after every update. It covers the next change to the watcher too, which a one-off migration would not. This now waits on a second-opinion review and on CI, then on the maintainer.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain.

Summary

Restarts omarchy-crash-watch.service after the shell during update service restarts, so it uses the newly installed script.

  • The update service phase refreshes the crash watcher.

Reviews (4) · Last reviewed commit: "Merge quattro into fix/restart-crash-wat..." · Reviewed by Greptile

Comment thread bin/omarchy-update-restart Resolved
@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 13, 2026
quattro folded omarchy-system-reboot into omarchy-system, so the restart phase test stubs omarchy-system beside systemctl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 13, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging into quattro again, so I merged quattro back into your branch (a44820a) and checked it again on a worker built from the Omarchy ISO. The fix still holds.

The merge. quattro replaced omarchy-system-reboot with a single omarchy-system command, which conflicted with the stub list in test/shell.d/update-restart-phases-test.sh. The test now stubs omarchy-system and systemctl together. Your try-restart line and the earlier commits are unchanged.

Reproduction, at a44820a. I restarted the watcher, replaced /usr/bin/omarchy-crash-watch the way pacman does (a new file renamed over the old one), and ran omarchy-update-restart --services-only:

  • quattro: same PID, still reading /usr/bin/omarchy-crash-watch (deleted). Fails.
  • This head: new PID, reading the installed script. Passes.
  • This head with the try-restart line removed: same PID, still on the deleted inode. Fails.

With the watcher stopped, as omarchy-toggle-crash-capture leaves it, it was still stopped afterwards.

Tests on the worker. ./test/cli passes in full, including the vscode theme test that failed on quattro last time. crash-capture-test.sh, update-restart-phases-test.sh, update-sequence-test.sh, update-hook-security-test.sh, update-lock-test.sh and update-disk-space-test.sh all pass. CI is green.

Review. Reviewed by Claude Opus 5.5. The second opinion, Codex Medium, reviewed this head and found no defects. It agreed that the fix is proportionate and that the services phase is the right place, because omarchy-update runs it as the user right after the package transaction. It saw my reasoning before reviewing, so its agreement is not guaranteed to be independent. If the user manager can't be reached, the restart fails silently. That is deliberate: the shell restart just above it also never fails an update.

Related. This fixes #8613, and no other open pull request does. #7155 restarts the watcher once, in a migration for its own change, so the two don't compete. They do both add lines at the same spot in test/shell.d/crash-capture-test.sh, so whichever lands second will need a small merge.

This now waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 27, 2026
quattro removed the shell tests that only grep source text (omacom#16334), which conflicted with the grep this branch added to crash-capture-test.sh. Take quattro's file: update-restart-phases-test.sh already proves the restart by running omarchy-update-restart with a stubbed systemctl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging into quattro again, so I merged quattro back into your branch (bb072b4) and checked it again on a worker built from the Omarchy ISO. The fix still holds.

The merge. quattro removed the shell tests that only grep source text (#16334), and that conflicted with the grep -F 'try-restart …' check this branch added to test/shell.d/crash-capture-test.sh. I took quattro's version of that file. The restart is still covered by behaviour: test/shell.d/update-restart-phases-test.sh runs omarchy-update-restart with a stubbed systemctl and asserts the try-restart in the services phase and nothing in the reboot phase. Your change to bin/omarchy-update-restart merged unchanged.

What ran on the worker. I replaced /usr/bin/omarchy-crash-watch the way pacman does, then ran omarchy-update-restart --services-only. With quattro's script, the running watcher was still on /usr/bin/omarchy-crash-watch (deleted) afterwards, and the same happened with your line removed. At this head it was restarted onto the new file. ./test/cli passes, and so do update-restart-phases-test.sh (3/3), crash-capture-test.sh (28/28) and the other update-* shell tests. With the fix reverted, update-restart-phases-test.sh fails.

Second opinion. Codex Medium and muse-wonder (via pi, thinking high) each reviewed the merged head, including the conflict resolution, and found nothing wrong. They agreed with my reading, and their independence is not guaranteed.

Nothing is left for you to do. It is waiting on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 6, 2026
quattro moved the omarchy-restart-shell stub into the shared sudo boundary fixture (omacom#17524), which conflicted with the systemctl stub this branch adds to update-restart-phases-test.sh. Keep quattro's list and add systemctl to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging into quattro again, so I merged quattro back into your branch (da44a19) and checked it again on a worker built from the Omarchy ISO. The fix still holds.

The merge. quattro moved the omarchy-restart-shell stub out of test/shell.d/update-restart-phases-test.sh and into the shared sudo boundary fixture (#17524). That conflicted with the systemctl stub this branch adds to the same line. I kept quattro's list and added systemctl to it. The fixture doesn't create a systemctl stub of its own, so nothing collides. Your change to bin/omarchy-update-restart merged unchanged.

What ran on the worker. I replaced /usr/bin/omarchy-crash-watch the way pacman does, then ran omarchy-update-restart --services-only. With quattro's script, the running watcher was still reading /usr/bin/omarchy-crash-watch (deleted) afterwards, and the same happened with your line removed. At this head it was restarted onto the new file. With crash capture toggled off, the watcher stayed stopped. ./test/cli passes, and so do crash-capture-test.sh (28/28), update-restart-phases-test.sh (3/3) and seven other update-* shell tests. With the fix reverted, update-restart-phases-test.sh fails.

Second opinion. Codex Medium and muse-wonder (via pi, thinking high) each reviewed the merged head, including the conflict resolution, and found nothing wrong. They agreed with my reading, and their independence is not guaranteed. muse-wonder pointed out that a libalpm hook would run inside pacman's root transaction, where there is no user bus to reach the watcher's unit, which backs your choice of omarchy-update-restart over a hook.

Nothing is left for you to do. It's waiting on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-crash-watch stops sending crash notifications after an in-place upgrade (logs Unknown option:)

3 participants