-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass VIRTUALIZATION var to runsvdir for scripts #102
Conversation
This fixes the issues identified in #101 where the `VIRTUALIZATION` environment variable exported in `/etc/runit/1` is not available to runsv scripts. Allowing this will permit runsv services to do different things based on whether they're running in a container or not. (See void-linux/void-packages#41273 for an example of when this would be needed - this PR needs some modifications but it will be able to use this variable to determine which setup commands to run.)
cc @CameronNemo |
I don't like exporting that variable, this is not a standard and we shouldn't have to invent things and then depend on just for one service run script. The run script could just be changed to not exit if modprobe fails or use some other command to check if the module is loaded first and otherwise try modprobe and exit. |
That's what I had originally (void-linux/void-packages#41272) but it turns out that you also need a different cgroups mount if you're in a container. You can put it in Having a way for runsv to determine whether or not you're in a container is really useful. |
@sbromberger cgroups mounting is handled in this repo, in the pseudofs "core service". |
@Duncaen - Is it your recommendation that we re-implement the functionality of |
@CameronNemo this is a special cgroups mount for docker: https://github.com/void-linux/void-packages/blob/7ac4f42d9795a6bd0e8c523fd70cb6ab9fe902fc/srcpkgs/moby/files/docker/run#L6 is the way it's currently done, but this doesn't work in containers: you need |
#103 before I lose my train of thought |
relevant past discussion: void-linux/void-docs#151 (comment) |
This fixes the issues identified in #101 where the
VIRTUALIZATION
environment variable exported in/etc/runit/1
is not available to runsv scripts. Allowing this will permit runsv services to do different things based on whether they're running in a container or not. (See void-linux/void-packages#41273 for an example of when this would be needed - this PR needs some modifications but it will be able to use this variable to determine which setup commands to run.)Supersedes and obviates #101