Skip to content

media: set UMASK=002 on all linuxserver containers#599

Merged
ExtraToast merged 1 commit into
mainfrom
fix/media-stack-umask
Jun 8, 2026
Merged

media: set UMASK=002 on all linuxserver containers#599
ExtraToast merged 1 commit into
mainfrom
fix/media-stack-umask

Conversation

@ExtraToast

Copy link
Copy Markdown
Owner

Without an explicit UMASK, linuxserver images default to 022, which creates files as 0644 and directories as 0755 inside the media volumes. All containers run with PUID/PGID=1000, matching the NixOS deploy user (UID=1000, GID=1000), so the owning UID is always correct. The problem is the missing group-write bit.

The tmpfiles z rules set the top-level directories (/srv/media/Completed, /srv/media/Series, /srv/media/Films) to 0775 with deploy:deploy. Any subdirectories qbittorrent creates inside those directories are 0755 — not group-writable — because UMASK=022 strips the group write bit from newly created entries.

This breaks two things:

  • Samba shares on enschede-t1000-1 run under a different UID in the deploy group; without group-write they cannot write back to the library.
  • Sonarr/Radarr's post-import chown/chmod pass leaves files as 0644 rather than 0664, which can cause inconsistent behaviour when the *arr instance is restarted and reprocesses files under its own identity.

Setting UMASK=002 makes new files 0664 and new directories 0775, matching the intended parent-directory permissions throughout the media tree.

Applies to: qbittorrent, prowlarr (co-located in the downloads pod), sonarr, radarr, and bazarr.

Note on existing files: UMASK only affects newly created entries. Any files already on disk with 0644/0755 permissions will need a one-time chmod -R g+rw /srv/media on enschede-t1000-1 to align with the new default.

Without UMASK, linuxserver images default to 022, which creates files
as 0644 and directories as 0755. The deploy group is GID 1000 and all
containers run PGID=1000, so the host and container identities align —
but files created inside the Completed/Series/Films trees are not
group-writable.

UMASK=002 makes new files 0664 and directories 0775, matching the
parent directories (0775 deploy:deploy) set by the tmpfiles z-rules.
This ensures Samba (running as a different uid in the deploy group),
the *arr import/delete cycle, and any future group-identity tooling
can all write freely without needing to be the owning UID.

Applies to: qbittorrent, prowlarr (downloads pod), sonarr, radarr,
bazarr.
@ExtraToast ExtraToast added the bug Something isn't working label Jun 8, 2026
@ExtraToast ExtraToast self-assigned this Jun 8, 2026
@ExtraToast ExtraToast merged commit 46ec9fb into main Jun 8, 2026
127 of 139 checks passed
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.

1 participant