Skip to content

feat(transmission): revert to VirtioFS with deferred cleanup#102

Merged
smartwatermelon merged 8 commits intomainfrom
claude/revert-to-virtiofs-20260328
Mar 29, 2026
Merged

feat(transmission): revert to VirtioFS with deferred cleanup#102
smartwatermelon merged 8 commits intomainfrom
claude/revert-to-virtiofs-20260328

Conversation

@smartwatermelon
Copy link
Copy Markdown
Owner

Summary

  • Revert Transmission data volume from VM-internal NFS to VirtioFS (host NFS passthrough) — vzNAT drops TCP forwarding unpredictably, causing Permission denied (13)
  • Change delete-local-data to false in trigger watcher torrent removal to avoid .nfs.* silly-rename files through VirtioFS
  • Add pending-move-cleanup.sh — hourly sweep that only removes directories confirmed absent from Transmission's torrent list via RPC (safe for un-processed torrents, failed FileBot, ISOs)
  • Remove VM-internal NFS mount setup, watchdog timer, and systemd units from setup script

Context

VM-internal NFS mount (implemented 2026-03-16) was unreliable due to Apple vzNAT losing TCP forwarding to LAN hosts while ICMP continued working. This caused the NFS mount inside the Podman VM to drop, triggering Permission denied errors. Occurred 3 times in one session on 2026-03-28.

The host-side NFS mount (managed by the existing macOS watchdog) is rock-solid. VirtioFS passthrough reintroduces .nfs.* silly-rename files, mitigated by separating "release the lock" (torrent removal without file deletion) from "delete the files" (hourly cleanup script).

Test plan

  • Container starts with VirtioFS volume, port 9091 open
  • Container can write to NFS via VirtioFS (write test OK)
  • Torrents start without Permission denied errors (18 peers connected)
  • Cleanup script runs clean on empty pending-move/
  • Shellcheck clean on all modified/new scripts
  • Live startup script updated to match

AI review: code-reviewer + adversarial-reviewer (1 clean iteration, pre-commit + pre-push)

🤖 Generated with Claude Code

Claude Code Bot and others added 5 commits March 28, 2026 23:20
Replace VM-internal NFS mount with VirtioFS pass-through from the host
NFS mount at ~/.local/mnt/DSMedia. Apple's vzNAT keeps dropping TCP
connectivity to the NAS, making the VM-internal NFS mount unreliable.

Removes Section 2b (VM-internal NFS mount setup via systemd) and
Section 2c (NFS watchdog timer) since both are unnecessary when the
host NFS mount is passed through via VirtioFS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update the podman-machine-start.sh template to use the VirtioFS
pass-through path instead of the VM-internal NFS mount. Removes the
pre-start NFS mount check (no longer needed with VirtioFS) and uses
NFS_MOUNT_POINT variable for the data volume path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change delete-local-data from true to false in torrent removal. This
lets Transmission close its FDs without triggering .nfs.* silly-renames
through VirtioFS. Actual cleanup of pending-move/ is handled by a
separate periodic script that verifies each directory is no longer
tracked by Transmission before deleting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hourly sweep of pending-move/ that only removes directories confirmed
absent from Transmission's torrent list via RPC. Prevents deletion of
un-processed torrents, failed FileBot runs, and non-media files (ISOs).

Companion to the delete-local-data:false change — separates 'release
the lock' (torrent removal) from 'delete the files' (this script).
Adds pending-move-cleanup.sh deployment and an hourly LaunchAgent
to podman-transmission-setup.sh.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Replace hardcoded DSMedia with __NAS_SHARE_NAME__ placeholder
   (MEDIUM: script would silently skip cleanup for non-default share names)

2. Replace grep/sed JSON parsing with python3 json module
   (HIGH: regex couldn't handle escaped quotes in torrent names,
   potentially causing false "not tracked" matches and data deletion)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace hardcoded DSMedia in MACOS_NAS_PREFIX with __NAS_SHARE_NAME__
placeholder, and add sed substitution in setup script deployment.

Addresses Seer finding on PR #102.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace hardcoded DSMedia with ${NAS_SHARE_NAME} in the confirmation
prompt and NAS bind mount validation section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@smartwatermelon smartwatermelon merged commit ec79837 into main Mar 29, 2026
20 checks passed
@smartwatermelon smartwatermelon deleted the claude/revert-to-virtiofs-20260328 branch March 29, 2026 07:14
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.

1 participant