Repository navigation
Guard LSIO conf append for parity with non-LSIO - #385
Merged
Merged
Conversation
Copilot round-4 on PR #381 flagged that the LSIO init script appends to /config/etc/mediaserver.conf without checking the result. The script runs as root so writability normally is not an issue, but the underlying /config mount can be on a read-only filesystem or otherwise rejected — a silent fail would leave mediaserver running without the OS variant override and the chown would also fail. Apply the same defensive pattern Docker/entrypoint.sh uses: wrap the append in an if and log a clear stderr warning on failure. Only chown on successful write (no point chowning a file that wasn't appended to).
There was a problem hiding this comment.
Pull request overview
Aligns the LSIO s6 init script with the non-LSIO entrypoint by guarding the append to mediaserver.conf with a conditional that logs a clear stderr warning on failure and only chowns after a successful write.
Changes:
- Wrap the
currentOsVariantOverride=dockerappend in anifto detect write failure. - Log "Added ..." on success and "Warning: failed to write ..." on failure.
- Update the comment to document the defensive write pattern.
1 of 3 tasks
ptr727
added a commit
that referenced
this pull request
May 25, 2026
## 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 - [x] `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.
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
Round-4 follow-up from Copilot's review on PR #381. The LSIO init script (
init-nx-relocate/run) appended to/config/etc/mediaserver.confwithout checking the result. The script runs as root, but the underlying/configmount can be on a read-only filesystem or otherwise rejected, so a silent failure would leave mediaserver running without the OS variant override.Fix
Apply the same defensive pattern non-LSIO already uses in
Docker/entrypoint.sh(added in #384): wrap the append in anif, log a clear stderr warning on failure, and onlychownon successful write. Both variants now log "Added" on success and "Warning: failed to write" on failure with a hint about what to check.Test plan
dotnet test CreateMatrixTests/CreateMatrixTests.csproj— 16/16 pass.