Make chown best-effort in LSIO init-nx-relocate - #387
Merged
Conversation
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.
There was a problem hiding this comment.
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
chownof/config/etc/mediaserver.confin a best-effort guard (if ! chown ...) so failures don’t break the oneshot service. - Emit a clear stderr warning when
chownfails, while continuing startup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Copilot flagged on PR #381 (round-5 & round-6) that the
chownadded by #385 sits at the end of the success path in the LSIO init script. Becauseinit-nx-relocateis 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
chownin anif-guard. On failure, log a clear stderr warning ("filesystem may not support ownership changes — continuing") and fall through; the outerfialways 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./configvolume 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.