Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>, Christian Kniep <ckniep@××××××.com>
Subject: Re: [gentoo-dev] rfc: /etc/hostname on gentoo
Date: Tue, 23 Aug 2016 20:25:47
Message-Id: CAGfcS_mT4T_7HkHdfskJax3PHFtu-rKQ8iD++kiyVdWpJyTt=g@mail.gmail.com
In Reply to: Re: [gentoo-dev] rfc: /etc/hostname on gentoo by William Hubbs
1 On Tue, Aug 23, 2016 at 3:57 PM, William Hubbs <williamh@g.o> wrote:
2 >
3 > I am planning to change the logic in /etc/init.d/hostname so that if
4 > /etc/hostname exists, the first word out of that file will be used as
5 > the hostname rather than any setting in /etc/conf.d/hostname. If you
6 > don't want /etc/hostname, just don't create it and the settings from
7 > /etc/conf.d/hostname will still be used.
8 >
9
10 Keep in mind that this is potentially problematic for a few reasons:
11
12 1. The hostname could change after openrc is done setting it. If it
13 does, a program that reads /etc/hostname won't get the real hostname.
14
15 2. You could have a situation where multiple containers use the same
16 /etc. Obviously in this situation you wouldn't want to store the
17 hostname anywhere in /etc unless you wanted them to all have the same
18 hostname. It would be better to obtain it from dhcp, or to have it
19 set before init is run during initialization.
20
21 The main danger is people not thinking of all the scenarios. I'm not
22 quite sure why we even need /etc/hostname now given these issues and
23 the fact that we've apparently gotten along for a long time without
24 it. Have we ever gotten around to making /etc/mtab a symlink yet? I
25 know it wasn't for a long time. It seems like we are moving away from
26 container support when we should be moving towards it if anything...
27
28 --
29 Rich

Replies

Subject Author
Re: [gentoo-dev] rfc: /etc/hostname on gentoo William Hubbs <williamh@g.o>