On Mon, Aug 22, 2016 at 1:03 PM, William Hubbs <willi...@gentoo.org> wrote:
>
> I'm not sure about putting this in /run for a couple of reasons:
>
> The contents of this file is a setting, like /etc/conf.d/hostname, which
> will be set by the user.

There is no reason a script can't populate /run with the right thing.
For example, with systemd you can set up a static networking config
with a static DNS, and it will populate a resolv.conf in /run with
whatever it parsed out of your networkd configuration.  Or you can
tell it to use dhcp in which case it populates /run with whatever the
dhcp server gives it.

The idea is that only one tool has to worry about where to get the
right network settings from, and everything else can just read them in
whatever format they prefer from wherever it is preferred.

However, it isn't the only way to accomplish this goal.  You could
just keep writing to /etc.  That does break in situations where you
want /etc to be read-only, etc.

>
> The other reason is, I don't know enough about containers to know if
> they will have a separate /run from the host.
>

Typically containers will have their own /run.  Containers were one of
the big reasons to not store hostnames in /etc, since then you can
share a single image across many containers, with a static /etc, and
the dynamic stuff all goes in /run.  Containers are also one of the
reasons for ditching /etc/mtab.

-- 
Rich

Reply via email to