Add support for custom rclone options and fix defuct processes #85
+144
−38
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.
Hi and thanks for your work on this!
This PR includes the following changes:
Mounter Parameters
This PR adds support for custom mounter parameters (although it is only implemented for rclone as of now). I needed to be able to specify additional parameters to rclone as the
--s3-provider=AWS
flag broke support for mounting MinIO buckets. I'm not sure why the tests didn't catch that (I guess thedev-full
is not updated) but with this PR it's possible to overwrite the flags. The additional mounter parameters must be prefixed with the mounter name so it's more obvious what those parameters are for.An example would be:
Build Tags
It's now possible to include/exclude support for mounters from the binary. The mounters are still installed in the Docker image. I basically needed this since I wasn't able to get the go build with goofys to work as it always errors with some strange Go runtime linking in
github.com/kahing/fusego
.By default, the docker image will contain support for all mounters but it's now possible to specify it:
Defunct Processes
Additionally, this PR fixes the issue with
defunct
processes.We're running in the container as PID-1 which gets some special treatment by the kernel. In particular, if a process in the container terminates and there are still active child processes, the kernel will move those orphaned processes to be child processes of PID-1.
Init-systems are expected to handle this case by reaping those "orphan" processes once they exit. The kernel notifies the then active parent process (either the real parent or PID-1 in case the real parent terminated) by sending a
SIGCHLD
.Since all available mounters are instructed to daemonize, we need to reap the daemonized processes since their parent (the mounter) exists once the daemon is running.