Skip to content

Store update transcript in private XDG directory instead of shared /tmp - #18399

Open
Zhann-th wants to merge 2 commits into
omacom:quattrofrom
Zhann-th:fix-update-log-path
Open

Zhann-th wants to merge 2 commits into
omacom:quattrofrom
Zhann-th:fix-update-log-path

Conversation

@Zhann-th

Copy link
Copy Markdown

Summary

Move the omarchy-update transcript from the shared, predictable /tmp/omarchy-update.log path to the user's private XDG state directory (${XDG_STATE_HOME:-~/.local/state}/omarchy/update.log).

Context

Using a fixed path in world-writable /tmp allows unprivileged processes or multi-user file permission collisions to cause errors during script -qefc, preventing the update from running. Storing the transcript in the user's state directory eliminates the collision while preserving backwards compatibility in omarchy-update-analyze-logs.

@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with two non-blocking findings from the previous review still outstanding.

Findings

  1. P2 Warnings use an old log ▶
  2. P2 Guide points to wrong log ▶

Summary

Moves the update transcript from shared /tmp storage to the user's XDG state directory.

  • Update transcripts now go to the user's XDG state directory.

No new findings were identified in the changes since the previous review.

Reviews (2) · Last reviewed commit: "Update docs to reflect new XDG transcrip..." · Reviewed by Greptile

Comment on lines +5 to +6
update_log="${OMARCHY_UPDATE_LOG:-${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/update.log}"
[[ -f $update_log ]] || update_log="/tmp/omarchy-update.log"

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 Warnings use an old log

If a previous run left an XDG transcript behind, updating after a downgrade can make omarchy-update-analyze-logs read that stale file. The older updater writes to /tmp/omarchy-update.log without setting OMARCHY_UPDATE_LOG, then installs the new analyzer before calling it. This existence check selects the old XDG file and can miss the current run's initramfs warning.

When OMARCHY_UPDATE_LOGGED is set but OMARCHY_UPDATE_LOG is absent, use the legacy transcript.

Comment thread bin/omarchy-update
}

if [[ -z ${OMARCHY_UPDATE_LOGGED:-} ]]; then
update_log="${OMARCHY_UPDATE_LOG:-${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/update.log}"

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 Guide points to wrong log

The new transcript path leaves docs/update-process.md pointing readers to /tmp/omarchy-update.log. Its state-file table, update flow, and debugging instructions now identify a missing or stale file instead of the current transcript. Update those references alongside this change, including the OMARCHY_UPDATE_LOG override and legacy fallback.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, @Zhann-th. Before anyone verifies it, it has to be classified, and the two models that classified it disagreed. I (Claude Opus 5.5) read it as a bug fix: script can't open /tmp/omarchy-update.log when another account already owns it, for example after a sudo omarchy update or on a machine with more than one user, and then omarchy update doesn't run at all. Codex at medium effort read it as an enhancement, a change to where the transcript lives. Because they disagree, it gets no class label, and it hasn't been run on a test machine yet. That waits until the maintainer settles what it is.

From reading the diff against quattro (nothing was run):

  • It no longer merges cleanly. End omarchy update when its terminal closes at a prompt #16045 rewrote the same exec env OMARCHY_UPDATE_LOGGED=1 ... script -qefc line in bin/omarchy-update. It now builds script_command with SHELL handling and ends with exit $?. To resolve the conflict, keep that version and swap "$update_log" (plus OMARCHY_UPDATE_LOG="$update_log") in for the /tmp path.
  • Greptile's note about the docs is already covered by the second commit: all four references in docs/update-process.md are updated.
  • Greptile's other note holds when you read the code. bin/omarchy-update-analyze-logs uses the XDG log whenever that file exists. Here is the case where that goes wrong. A machine runs this version once, which leaves an XDG log. It then moves to an older release, for example through a channel switch. Later it updates back to this version. During that update, the old omarchy-update is still the process running: it writes to /tmp and doesn't set OMARCHY_UPDATE_LOG. The new analyzer then scans the stale XDG log instead of this run's transcript. Falling back to /tmp only when OMARCHY_UPDATE_LOGGED is set without OMARCHY_UPDATE_LOG would close that gap. This only comes up during the switch between versions.

No other open pull request makes this change. Next step: the maintainer decides how to classify it. The conflict is yours to resolve whenever suits you.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants