fix: Pass CleanupHost boolean to starter correctly #779
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.
Description of the Pull Request (PR):
The experimental
--sif-fusecode was attempting to pass the boolean that controls whether starter spawns the CleanupHost process, for unmounting the FUSE SIF mount, in the starter config structure.The starter config structure is setup from the Go engine 'prepare' code, which runs in stage1 after the point at which CleanupHost is
spawned from the starter C code... so the boolean was never true.
Unfortunately, all the tests we have were passing, because due to a bad negation in an if statement, the
CleanupHostprocesswas always executed.
Switch to using an env var (
CLEANUP_HOST) to control whether theCleanupHostprocess is spawned by starter. This is the right way to control starter behavior that needs to occur before 'prepare' in stage1. It's the same approach used to control whether the overlay module is loaded viaLOAD_OVERLAY_MODULE.While we are at it, ensure a
CleanupHostprocess is never run in setuid mode. We don't support this yet, and if support is added we need to pay attention to permanent priv drop etc.Add a bit more debug logging so it's easier to see what's going on.
This fixes or addresses the following GitHub issues:
Before submitting a PR, make sure you have done the following:
make checkand tested this PR locally with amake test, andmake testallif possible (see CONTRIBUTING.md).