Skip to content

Install rtkit on all platforms to prevent RLIMIT_RTTIME=0 kills (#16348) - #16353

Closed
szaidi-code wants to merge 1 commit into
omacom:quattrofrom
szaidi-code:fix/rtkit-rttime-watchdog-16348
Closed

szaidi-code wants to merge 1 commit into
omacom:quattrofrom
szaidi-code:fix/rtkit-rttime-watchdog-16348

Conversation

@szaidi-code

Copy link
Copy Markdown
Contributor

Summary

Fixes #16348.

On systems without rtkit installed (rtkit was previously listed only in install/omarchy-aarch64.packages, not install/omarchy-base.packages), xdg-desktop-portal reports RTTimeUSecMax = 0. PipeWire's client libpipewire-module-rt (rtportal.enabled) applies that zero budget as a hard RLIMIT_RTTIME = 0/0 in every PipeWire client, including quickshell (omarchy-shell).

Every application started from the Omarchy launcher inherits RLIMIT_RTTIME = 0/0, and the kernel RT watchdog sends an unconditional SIGKILL (RT Watchdog Timeout (hard)) when a thread arms a per-thread CPU-time timer (CLOCK_THREAD_CPUTIME_ID), silently killing Electron/Chromium apps such as claude-desktop.

Changes

  • Move rtkit from install/omarchy-aarch64.packages to install/omarchy-base.packages so all platforms (x86 and aarch64*) include rtkit in their default package set.
  • Add migration migrations/1792716821.sh to install rtkit when missing and restart xdg-desktop-portal.service (which caches the realtime budget at startup) before the post-update shell restart.
  • Update test/shell.d/platform-packages-test.sh and add test/shell.d/rtkit-migration-test.sh.

Test Plan

  • ./test/shell.d/platform-packages-test.sh
  • ./test/shell.d/rtkit-migration-test.sh

…om#16348)

Without `rtkit` installed, `xdg-desktop-portal` reports a realtime budget
of `RTTimeUSecMax = 0`. PipeWire's client `libpipewire-module-rt`
(`rtportal.enabled`) applies that budget as a hard `RLIMIT_RTTIME` of
`0/0` in every PipeWire client, including `quickshell` (`omarchy-shell`).

Every application launched from `omarchy-shell` inherits
`RLIMIT_RTTIME = 0/0`, causing the kernel realtime CPU watchdog to send
`SIGKILL` (`RT Watchdog Timeout (hard)`) whenever a thread uses a
per-thread CPU-time timer (`CLOCK_THREAD_CPUTIME_ID`), as Chromium and
Electron processes do.

Move `rtkit` from `install/omarchy-aarch64.packages` into
`install/omarchy-base.packages` so every platform (`x86` and `aarch64*`)
installs it by default, and add a migration that installs `rtkit` if
missing and restarts `xdg-desktop-portal.service` before the post-update
shell reload.

Fixes omacom#16348
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches default installs and update runs across supported architectures.

Fix the skipped portal restart and remove the prohibited package assertion before merging.

Findings

  1. P1 Stale portal budget survives ▶
  2. P2 Package assertion repeats configuration ▶

Summary

This PR moves rtkit into the shared package list and adds a migration to install it and refresh the running portal.

  • Default installs include rtkit on x86 and aarch64.
  • Updates add missing rtkit before refreshing the portal.

Reviews (1) · Last reviewed commit: "Install rtkit on all platforms to preven..." · Reviewed by Greptile

Comment thread migrations/1792716821.sh
Comment on lines +6 to +10
if omarchy-pkg-missing rtkit; then
omarchy-pkg-add rtkit
# xdg-desktop-portal caches the realtime budget when it starts; restart it so
# the shell reload that follows migrations picks up the RTKit budget.
systemctl --user try-restart xdg-desktop-portal.service >/dev/null 2>&1 || true

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.

P1 Stale portal budget survives

On an older N1x install, 1790984500.sh installs rtkit earlier in the same migration run without restarting the portal. This migration then skips its whole block because the package is present. If the portal started without rtkit, it keeps its cached zero budget, so the replacement shell and launched apps can still be killed.

Keep the package install conditional, but move the portal restart outside that condition. Update the already-installed test case to expect the restart.

Knowledge Base Used: Restore direct RTKit access for speaker tuning

printf '%s\n' "$defaults" >"$work/$platform.packages"

grep -Fxq superwhisper-bin "$work/$platform.packages" || fail "$platform: Superwhisper is a default package"
grep -Fxq rtkit "$work/$platform.packages" || fail "$platform: rtkit is a default package"

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.

P2 Package assertion repeats configuration

This assertion checks only that the newly added package-list entry appears in the output. AGENTS.md explicitly forbids tests for package-list entries and checks that restate edited configuration. The existing base-list comparisons already cover the resolver's behavior. Remove this package-specific assertion before merging to satisfy that requirement.

Suggested change
grep -Fxq rtkit "$work/$platform.packages" || fail "$platform: rtkit is a default package"

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot omarchybot added the bug Something isn't working label Oct 23, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This fixes the same bug as #12428, which was opened first and is still open against quattro: both add rtkit to install/omarchy-base.packages and ship a migration that installs it and restarts xdg-desktop-portal, so the portal stops reporting the zero realtime budget that module-rt turns into RLIMIT_RTTIME = 0/0 for the shell and everything launched from it (#16348 here; #12443 and #9390 there). When two pull requests fix one bug, the older is the one carried forward unless the newer is clearly better, and here the older handles a case this one misses:

  • migrations/1792716821.sh restarts the portal only when its own install ran. On an N1x install still on an earlier image, the shipped 1790984500.sh installs rtkit earlier in the same update without restarting the portal, so this migration finds rtkit present and leaves the stale zero budget in place until the next login. Greptile raised the same point inline. Install rtkit so PipeWire gets realtime priority #12428 restarts the portal unconditionally, and omarchy-pkg-add is already a no-op when the package is installed.

What this one adds is dropping the rtkit entry from install/omarchy-aarch64.packages, which becomes redundant once the base list carries it (omarchy-pkg-defaults de-duplicates, so leaving it is harmless rather than wrong). That has been handed to #12428 to fold in, crediting you. The platform-packages-test.sh assertion would not carry over in any case: the repository's AGENTS.md asks for no test of a package-list entry.

Since #12428 is the one going forward, this pull request was not run on a worker. It stays open, and which of the two lands is the maintainer's decision.

Checked by Claude Opus 5.5 in Claude Code, reading both diffs against quattro and the migrations they interact with. Codex Medium was asked separately, without that conclusion, which of the two should go forward; it picked #12428 for the same N1x case and suggested the same aarch64 tidy-up.

@chessing234 chessing234 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.

all good

@emirb

emirb commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Thanks @szaidi-code and @chessing234!

omacom/omarchy#16824 · Give PipeWire realtime with… merged and includes your aarch64 change.

rtkit is now in the base list for every platform. Closing this in favour of it.

@emirb emirb closed this Oct 28, 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.

Without rtkit, apps started from omarchy-shell inherit RLIMIT_RTTIME=0 and the kernel RT watchdog SIGKILLs them (Electron/Chromium, claude-desktop)

4 participants