1 |
On Tue, Aug 23, 2016 at 04:25:30PM -0400, Rich Freeman wrote: |
2 |
> On Tue, Aug 23, 2016 at 3:57 PM, William Hubbs <williamh@g.o> wrote: |
3 |
> > |
4 |
> > I am planning to change the logic in /etc/init.d/hostname so that if |
5 |
> > /etc/hostname exists, the first word out of that file will be used as |
6 |
> > the hostname rather than any setting in /etc/conf.d/hostname. If you |
7 |
> > don't want /etc/hostname, just don't create it and the settings from |
8 |
> > /etc/conf.d/hostname will still be used. |
9 |
> > |
10 |
> |
11 |
> Keep in mind that this is potentially problematic for a few reasons: |
12 |
> |
13 |
> 1. The hostname could change after openrc is done setting it. If it |
14 |
> does, a program that reads /etc/hostname won't get the real hostname. |
15 |
|
16 |
This is also true for /etc/conf.d/hostname, so I don't see the problem |
17 |
here. |
18 |
|
19 |
> 2. You could have a situation where multiple containers use the same |
20 |
> /etc. Obviously in this situation you wouldn't want to store the |
21 |
> hostname anywhere in /etc unless you wanted them to all have the same |
22 |
> hostname. It would be better to obtain it from dhcp, or to have it |
23 |
> set before init is run during initialization. |
24 |
|
25 |
/etc/init.d/hostname doesn't run inside containers, so this is not |
26 |
relevant. |
27 |
|
28 |
> The main danger is people not thinking of all the scenarios. I'm not |
29 |
> quite sure why we even need /etc/hostname now given these issues and |
30 |
> the fact that we've apparently gotten along for a long time without |
31 |
> it. Have we ever gotten around to making /etc/mtab a symlink yet? I |
32 |
> know it wasn't for a long time. It seems like we are moving away from |
33 |
> container support when we should be moving towards it if anything... |
34 |
|
35 |
Container support is controlled by the keyword line in dependencies. |
36 |
OpenRC can detect most containers, so if you put the proper keywords on |
37 |
that line and RC_SYS is set correctly or the container is autodetected |
38 |
properly, openrc will not run the scripts that it shouldn't run in the |
39 |
container. |
40 |
|
41 |
Yes, /etc/mtab is a symlink by default now; that was taken care of a |
42 |
while back. |
43 |
|
44 |
William |