Skip to content

Make chown best-effort in LSIO init-nx-relocate - #387

Merged
ptr727 merged 1 commit into
developfrom
fix-chown-nonfatal
May 25, 2026
Merged

Make chown best-effort in LSIO init-nx-relocate#387
ptr727 merged 1 commit into
developfrom
fix-chown-nonfatal

Conversation

@ptr727

@ptr727 ptr727 commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

Copilot flagged on PR #381 (round-5 & round-6) that the chown added by #385 sits at the end of the success path in the LSIO init script. Because init-nx-relocate is an s6-rc oneshot service, a non-zero exit from its last command fails the service and breaks container init — even though the actual conf write succeeded. Filesystems that don't support ownership changes (SMB/NFS/Windows-backed) trigger this.

Fix

Wrap the chown in an if-guard. On failure, log a clear stderr warning ("filesystem may not support ownership changes — continuing") and fall through; the outer fi always evaluates to 0, so the script exits cleanly. The actual conf-write outcome still drives the user-facing success/failure messaging.

Test plan

  • dotnet test CreateMatrixTests/CreateMatrixTests.csproj — 16/16 pass.
  • CI matrix passes.
  • Manual: mount a /config volume backed by an exFAT or similar non-chown filesystem, start the LSIO container, confirm the s6 oneshot completes (container reaches running state, mediaserver launches) and the warning appears in container logs.

Copilot flagged on PR #381 that the new currentOsVariantOverride
injection's chown is the last command on the success path and would
exit non-zero on filesystems that don't support ownership changes
(common on SMB/NFS/Windows-backed mounts). Because init-nx-relocate
is an s6-rc oneshot, a non-zero exit fails the service and breaks
container startup — even though the conf write itself succeeded.

Wrap the chown in an `if`-guard that logs a clear stderr warning on
failure and continues. The outer `fi` always evaluates to 0, so the
script exits cleanly regardless of chown's result.
Copilot AI review requested due to automatic review settings May 25, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents LSIO container initialization from failing when /config is mounted on a filesystem that does not support ownership changes (e.g., some SMB/NFS/Windows-backed mounts). It updates the init-nx-relocate s6-rc oneshot script so that a chown failure no longer causes the oneshot service (and thus container init) to fail after successfully writing mediaserver.conf.

Changes:

  • Wrap chown of /config/etc/mediaserver.conf in a best-effort guard (if ! chown ...) so failures don’t break the oneshot service.
  • Emit a clear stderr warning when chown fails, while continuing startup.

@ptr727
ptr727 merged commit f3f5a1c into develop May 25, 2026
40 checks passed
@ptr727
ptr727 deleted the fix-chown-nonfatal branch May 25, 2026 19:09
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