Skip to content
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

missing NIS domainname #592

Closed
justincormack opened this issue Oct 20, 2016 · 8 comments
Closed

missing NIS domainname #592

justincormack opened this issue Oct 20, 2016 · 8 comments
Milestone

Comments

@justincormack
Copy link
Contributor

We have had various complaints in Docker eg see moby/moby#27067 that you cannot set the domainname, just the hostname. As runc has no way to set the domain name, we cannot easily implement this. Can we add a new optional field for domain name? It would exactly match hostname, except on Linux it would use the setdomainname(2) syscall not sethostname(2).

This is used by some applications eg NIS (where it originated as a field I believe).

Have not yet determined if Windows has a comparable field, it seems likely. Other Unixes certainly do.

Happy to add a patch (and in runc) if this is acceptable.

@cyphar
Copy link
Member

cyphar commented Oct 20, 2016

Heh, you beat me to this. 😉

I reckon the config should look like:

{ "nis": { "hostname": "a", "domainname": "b.com" } }

Where you can replace "nis" with "uname" (or "uts") if more appropriate.

@justincormack
Copy link
Contributor Author

Actually I think this may be Linux specific, looking at FreeBSD https://www.freebsd.org/cgi/man.cgi?query=domainname&sektion=1&apropos=0&manpath=FreeBSD+10.3-RELEASE+and+Ports it is set in /etc/rc.conf not kernel mediated and read via sysctl so there would be nothing for runc to usefully do here.

@cyphar
Copy link
Member

cyphar commented Oct 20, 2016

We could shove it in config-linux then under nisdomainname. But maybe Solaris implements it?

@justincormack
Copy link
Contributor Author

yes I think that may be the best option.

@justincormack justincormack changed the title missing domainname missing NIS domainname Oct 20, 2016
@justincormack
Copy link
Contributor Author

It looks to me like Solaris is like FreeBSD, although I could not find a definitive answer. BSD says their version came from SunOS. It is not in Posix as part of uname.

@hqhq hqhq added this to the 1.1.0 milestone Dec 24, 2016
@cyphar
Copy link
Member

cyphar commented Jun 17, 2018

Thinking about this more I think it's possible to just use kernel.domainname to set the domain name without needing any OCI support (especially because the idea would be to just make it Linux-specific anyway).

@cyphar
Copy link
Member

cyphar commented Jun 18, 2018

I've figured out this can be entirely done with opencontainers/runc#1827 and moby/moby#37302.

cyphar added a commit to cyphar/docker that referenced this issue Nov 30, 2018
The OCI doesn't have a specific field for an NIS domainname[1] (mainly
because FreeBSD and Solaris appear to have a similar concept but it is
configured entirely differently).

However, on Linux, the NIS domainname can be configured through both the
setdomainname(2) syscall but also through the "kernel.domainname"
sysctl. Since the OCI has a way of injecting sysctls this means we don't
need to have any OCI changes to support NIS domainnames (and we can
always switch if the OCI picks up such support in the future).

It should be noted that because we have to generate this each spec
creation we also have to make sure that it's not clobbered by the
HostConfig. I'm pretty sure making this change generic (so that
HostConfig will not clobber any pre-set sysctls) will not cause other
issues to crop up.

[1]: opencontainers/runtime-spec#592

Signed-off-by: Aleksa Sarai <asarai@suse.de>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this issue Nov 30, 2018
The OCI doesn't have a specific field for an NIS domainname[1] (mainly
because FreeBSD and Solaris appear to have a similar concept but it is
configured entirely differently).

However, on Linux, the NIS domainname can be configured through both the
setdomainname(2) syscall but also through the "kernel.domainname"
sysctl. Since the OCI has a way of injecting sysctls this means we don't
need to have any OCI changes to support NIS domainnames (and we can
always switch if the OCI picks up such support in the future).

It should be noted that because we have to generate this each spec
creation we also have to make sure that it's not clobbered by the
HostConfig. I'm pretty sure making this change generic (so that
HostConfig will not clobber any pre-set sysctls) will not cause other
issues to crop up.

[1]: opencontainers/runtime-spec#592

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Upstream-commit: 7417f5057568eacf835e9f8ffdf7263e75908f0a
Component: engine
cyphar added a commit to SUSE/docker-ce that referenced this issue Dec 3, 2018
The OCI doesn't have a specific field for an NIS domainname[1] (mainly
because FreeBSD and Solaris appear to have a similar concept but it is
configured entirely differently).

However, on Linux, the NIS domainname can be configured through both the
setdomainname(2) syscall but also through the "kernel.domainname"
sysctl. Since the OCI has a way of injecting sysctls this means we don't
need to have any OCI changes to support NIS domainnames (and we can
always switch if the OCI picks up such support in the future).

It should be noted that because we have to generate this each spec
creation we also have to make sure that it's not clobbered by the
HostConfig. I'm pretty sure making this change generic (so that
HostConfig will not clobber any pre-set sysctls) will not cause other
issues to crop up.

[1]: opencontainers/runtime-spec#592

SUSE-Bugs: bsc#1001161
Signed-off-by: Aleksa Sarai <asarai@suse.de>
adhulipa pushed a commit to adhulipa/docker that referenced this issue Apr 11, 2019
The OCI doesn't have a specific field for an NIS domainname[1] (mainly
because FreeBSD and Solaris appear to have a similar concept but it is
configured entirely differently).

However, on Linux, the NIS domainname can be configured through both the
setdomainname(2) syscall but also through the "kernel.domainname"
sysctl. Since the OCI has a way of injecting sysctls this means we don't
need to have any OCI changes to support NIS domainnames (and we can
always switch if the OCI picks up such support in the future).

It should be noted that because we have to generate this each spec
creation we also have to make sure that it's not clobbered by the
HostConfig. I'm pretty sure making this change generic (so that
HostConfig will not clobber any pre-set sysctls) will not cause other
issues to crop up.

[1]: opencontainers/runtime-spec#592

Signed-off-by: Aleksa Sarai <asarai@suse.de>
cyphar added a commit to SUSE/docker-ce that referenced this issue May 3, 2019
The OCI doesn't have a specific field for an NIS domainname[1] (mainly
because FreeBSD and Solaris appear to have a similar concept but it is
configured entirely differently).

However, on Linux, the NIS domainname can be configured through both the
setdomainname(2) syscall but also through the "kernel.domainname"
sysctl. Since the OCI has a way of injecting sysctls this means we don't
need to have any OCI changes to support NIS domainnames (and we can
always switch if the OCI picks up such support in the future).

It should be noted that because we have to generate this each spec
creation we also have to make sure that it's not clobbered by the
HostConfig. I'm pretty sure making this change generic (so that
HostConfig will not clobber any pre-set sysctls) will not cause other
issues to crop up.

[1]: opencontainers/runtime-spec#592

SUSE-Bugs: bsc#1001161
Signed-off-by: Aleksa Sarai <asarai@suse.de>
@AkihiroSuda
Copy link
Member

Completed in:

@AkihiroSuda AkihiroSuda modified the milestones: 1.Y.0, v1.1.0 Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants