On 08/23/2016 12:57 PM, William Hubbs wrote: > 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 > That seems like a fair compromise. Those who want /etc/hostname get to use it, those who don't won't need to change anything.
Will other packages be able to modify or create the file and thus jeopardize anything? -- Daniel Campbell - Gentoo Developer OpenPGP Key: 0x1EA055D6 @ hkp://keys.gnupg.net fpr: AE03 9064 AE00 053C 270C 1DE4 6F7A 9091 1EA0 55D6
signature.asc
Description: OpenPGP digital signature