Skip to content

Keep the fcitx5 unit inert when fcitx5 isn't installed - #11694

Merged
dhh merged 2 commits into
omacom:quattrofrom
therk:fcitx5-condition-binary
Oct 22, 2026
Merged

dhh merged 2 commits into
omacom:quattrofrom
therk:fcitx5-condition-binary

Conversation

@therk

@therk therk commented Sep 13, 2026

Copy link
Copy Markdown

omarchy-fcitx5.service has Restart=always with RestartSec=2 and ExecStart=/usr/bin/fcitx5. fcitx5 is in omarchy-base.packages, but a trimmed or derived image can ship the unit without the binary — and install/user/first-run/enable-user-units.sh enables the unit unconditionally either way. When the binary isn't there, the unit fails at 203/EXEC and systemd retries it forever.

On the aarch64 image I hit this on:

$ systemctl --user show omarchy-fcitx5.service -p NRestarts
NRestarts=20943

$ journalctl --user -b | grep -c 'omarchy-fcitx5.service'
105828

That is most of what the session's journal contains, and it runs for as long as the session does.

enable-user-units.sh already documents the mechanism this unit was missing:

ConditionPath* in the unit files keep the enabled units inert on hardware they don't apply to.

omarchy-tailscale-receive.service guards its binary exactly this way with ConditionPathExists=/usr/bin/tailscale. This adds the same guard here, so the unit stays enabled and simply doesn't run where fcitx5 is absent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ALLhsWEVznJX5Js4CM59ZV

fcitx5 is in omarchy-base.packages, but a trimmed or derived image can
ship the unit without the binary, and first-run/enable-user-units.sh
enables this unit unconditionally either way. With Restart=always and
RestartSec=2, that install spends its whole session failing at
203/EXEC twice a second.

On the aarch64 image I found this on, the unit had restarted 20,943
times in one session and accounted for 105,828 journal lines, which is
most of what the log contains.

enable-user-units.sh already says ConditionPath* in the unit files is
what keeps an enabled unit inert where it does not apply, and
omarchy-tailscale-receive.service guards its binary exactly this way.
This unit was missing its half of that.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ALLhsWEVznJX5Js4CM59ZV
@csfh csfh added enhancement New feature or request verified Omarchy Triage has verified that this issue is ready for final review labels Sep 13, 2026
Removing ConditionPathExists=/usr/bin/fcitx5 left every existing fcitx5 assertion in systemd-test.sh passing, so the restart loop could come back unnoticed. The comment said the unit fails twice a second; RestartSec=2 makes it once every two seconds, which is what a worker without the binary showed (13 restarts in 30s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Adds a condition to prevent a systemd service from retrying when its binary is missing.

The PR appears safe to merge.

Summary

The PR adds a binary-presence condition to the fcitx5 user service so installations without fcitx5 do not repeatedly attempt to start it.

  • Adds a shell-test assertion for the condition.

Reviews (1) · Last reviewed commit: "Assert the fcitx5 binary guard and corre..."

@omarchybot omarchybot added the ready Good to merge label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on a disposable Omarchy worker (x86_64, systemd 261, live Hyprland session), with /usr/bin/fcitx5 moved out of the way:

  • quattro's unit restart-looped at 203/EXEC: 13 restarts in 30 seconds.
  • This branch's unit was skipped on ConditionPathExists=/usr/bin/fcitx5, with no restarts and one journal line.
  • With the binary back, the unit started and stayed running, so the guard does not touch a normal install.

./test/cli and test/shell.d/systemd-test.sh and config-test.sh pass on the head.

I pushed one commit, 5b6b9f2, with two small fixes:

  • systemd-test.sh already asserts every other line of this unit, but not the new guard, so deleting it would have brought the loop back with every test still green. It now asserts it, and the test fails when the line is removed.
  • The comment said the unit fails "twice a second". With RestartSec=2 it is once every two seconds, which matches what the worker showed.

Second opinion: Codex Medium reviewed both rounds. It raised the two points above, found nothing else, and found nothing left on the current head. It can read this session's reasoning, so its agreement is not guaranteed to be independent.

No competing pull request touches this unit. Waiting on the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants