On Tue, Aug 23, 2016 at 02:45:20PM -0400, Rich Freeman wrote: > Symlinking /proc into /etc/hostname is still useful because it not > only handles container hostnames (keep in mind that two containers > could share the same /etc), but it also covers cases where the > hostname changes, and it doesn't require writing to etc (which in > general shouldn't be used to store state). > > The people who are saying /etc/hostname shouldn't really exist are > completely right. However, if for whatever reason we did want to > provide it for compatibility (just like mtab), then a symlink to /proc > at least ensures it returns the same answer as the system call.
My understanding of /etc/hostname is it is a widely used standard for storing the name of the host and it is used to set the name of the host on bootup. I just ran a google search of /etc/hostname, and it gets a number of hits. Here is what I'm looking at in OpenRC: I am planning to change the logic in /etc/init.d/hostname so that if /etc/hostname exists, the first word out of that file will be used as the hostname rather than any setting in /etc/conf.d/hostname. If you don't want /etc/hostname, just don't create it and the settings from /etc/conf.d/hostname will still be used. It turns out this has nothing to do with the Docker situation I brought up. Whether or not a docker container should be able to access the hostname of the host it is running on is a separate question. William
signature.asc
Description: Digital signature
