1 |
On 08/23/2016 12:57 PM, William Hubbs wrote: |
2 |
> On Tue, Aug 23, 2016 at 02:45:20PM -0400, Rich Freeman wrote: |
3 |
>> Symlinking /proc into /etc/hostname is still useful because it not |
4 |
>> only handles container hostnames (keep in mind that two containers |
5 |
>> could share the same /etc), but it also covers cases where the |
6 |
>> hostname changes, and it doesn't require writing to etc (which in |
7 |
>> general shouldn't be used to store state). |
8 |
>> |
9 |
>> The people who are saying /etc/hostname shouldn't really exist are |
10 |
>> completely right. However, if for whatever reason we did want to |
11 |
>> provide it for compatibility (just like mtab), then a symlink to /proc |
12 |
>> at least ensures it returns the same answer as the system call. |
13 |
> |
14 |
> My understanding of /etc/hostname is it is a widely used standard for |
15 |
> storing the name of the host and it is used to set the name of the host |
16 |
> on bootup. I just ran a google search of /etc/hostname, and it gets a |
17 |
> number of hits. |
18 |
> |
19 |
> Here is what I'm looking at in OpenRC: |
20 |
> |
21 |
> I am planning to change the logic in /etc/init.d/hostname so that if |
22 |
> /etc/hostname exists, the first word out of that file will be used as |
23 |
> the hostname rather than any setting in /etc/conf.d/hostname. If you |
24 |
> don't want /etc/hostname, just don't create it and the settings from |
25 |
> /etc/conf.d/hostname will still be used. |
26 |
> |
27 |
> It turns out this has nothing to do with the Docker situation I brought |
28 |
> up. Whether or not a docker container should be able to access the |
29 |
> hostname of the host it is running on is a separate question. |
30 |
> |
31 |
> William |
32 |
> |
33 |
That seems like a fair compromise. Those who want /etc/hostname get to |
34 |
use it, those who don't won't need to change anything. |
35 |
|
36 |
Will other packages be able to modify or create the file and thus |
37 |
jeopardize anything? |
38 |
|
39 |
-- |
40 |
Daniel Campbell - Gentoo Developer |
41 |
OpenPGP Key: 0x1EA055D6 @ hkp://keys.gnupg.net |
42 |
fpr: AE03 9064 AE00 053C 270C 1DE4 6F7A 9091 1EA0 55D6 |