runtime-spec icon indicating copy to clipboard operation
runtime-spec copied to clipboard

missing NIS domainname

Open justincormack opened this issue 9 years ago • 7 comments

We have had various complaints in Docker eg see https://github.com/docker/docker/issues/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.

justincormack avatar Oct 20 '16 12:10 justincormack

Heh, you beat me to this. :wink:

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.

cyphar avatar Oct 20 '16 12:10 cyphar

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.

justincormack avatar Oct 20 '16 13:10 justincormack

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

cyphar avatar Oct 20 '16 13:10 cyphar

yes I think that may be the best option.

justincormack avatar Oct 20 '16 13:10 justincormack

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.

justincormack avatar Oct 20 '16 14:10 justincormack

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 avatar Jun 17 '18 07:06 cyphar

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

cyphar avatar Jun 18 '18 11:06 cyphar

Completed in:

  • https://github.com/opencontainers/runtime-spec/pull/1156

AkihiroSuda avatar Jan 29 '23 14:01 AkihiroSuda