On Tue, Aug 23, 2016 at 04:25:30PM -0400, Rich Freeman wrote:
> On Tue, Aug 23, 2016 at 3:57 PM, William Hubbs <willi...@gentoo.org> wrote:
> >
> > 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.
> >
> 
> Keep in mind that this is potentially problematic for a few reasons:
> 
> 1.  The hostname could change after openrc is done setting it.  If it
> does, a program that reads /etc/hostname won't get the real hostname.
 
 This is also true for /etc/conf.d/hostname, so I don't see the problem
 here.

> 2.  You could have a situation where multiple containers use the same
> /etc.  Obviously in this situation you wouldn't want to store the
> hostname anywhere in /etc unless you wanted them to all have the same
> hostname.  It would be better to obtain it from dhcp, or to have it
> set before init is run during initialization.

/etc/init.d/hostname doesn't run inside containers, so this is not
relevant.

> The main danger is people not thinking of all the scenarios.  I'm not
> quite sure why we even need /etc/hostname now given these issues and
> the fact that we've apparently gotten along for a long time without
> it.  Have we ever gotten around to making /etc/mtab a symlink yet?  I
> know it wasn't for a long time.  It seems like we are moving away from
> container support when we should be moving towards it if anything...

Container support is controlled by the keyword line in dependencies.
OpenRC can detect most containers, so if you put the proper keywords on
that line and RC_SYS is set correctly or the container is autodetected
properly, openrc will not run the scripts that it shouldn't run in the
container.

Yes, /etc/mtab is a symlink by default now; that was taken care of a
while back.

William

Attachment: signature.asc
Description: Digital signature

Reply via email to