Skip to content

fix(zsh): redirect TMPDIR to ~/tmp on TrueNAS hosts#202

Merged
laurigates merged 1 commit into
mainfrom
fix/zshenv-truenas-tmpdir
May 11, 2026
Merged

fix(zsh): redirect TMPDIR to ~/tmp on TrueNAS hosts#202
laurigates merged 1 commit into
mainfrom
fix/zshenv-truenas-tmpdir

Conversation

@laurigates
Copy link
Copy Markdown
Owner

Summary

  • TrueNAS mounts /tmp as tmpfs with noexec, which breaks chezmoi's run_* scripts (fork/exec on the materialized script returns EACCES).
  • Export TMPDIR=$HOME/tmp (on the main/home ZFS dataset, exec-allowed) when .chezmoi.kernel.osrelease contains truenas.
  • No-op on macOS and other Linux hosts.

Bootstrap

Applying this change itself still needs the workaround once, since the failing script runs before the new ~/.zshenv is in place:

TMPDIR="$HOME/tmp" chezmoi apply -v

After that, every new shell exports TMPDIR itself and bare chezmoi apply works.

Test plan

  • chezmoi execute-template < dot_zshenv.tmpl renders the export on the TrueNAS host.
  • Same render on macOS produces no TMPDIR block (gated by osrelease substring).
  • TMPDIR=$HOME/tmp chezmoi apply -v runs run_once_before_00-initial-setup.sh.tmpl successfully end-to-end.

🤖 Generated with Claude Code

TrueNAS mounts /tmp as tmpfs with noexec, which breaks chezmoi's
run_* script execution (fork/exec returns EACCES on the materialized
script). Override TMPDIR to ~/tmp on the main/home ZFS dataset, which
is exec-allowed.

Gated on .chezmoi.kernel.osrelease containing "truenas" so the export
stays a no-op on macOS and other Linux hosts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Broken Links Detected

Summary

Status Count
🔍 Total 128
✅ Successful 121
⏳ Timeouts 1
🔀 Redirected 0
👻 Excluded 5
❓ Unknown 0
🚫 Errors 1

Errors per input

Errors in docs/components.md

Errors in exact_dot_claude/docs/prds/daily-catchup.PRD.md


Please fix the broken links before merging.

@laurigates laurigates merged commit b4f7ea5 into main May 11, 2026
7 of 8 checks passed
@laurigates laurigates deleted the fix/zshenv-truenas-tmpdir branch May 11, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant