netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: Gioele Barabucci <gioele@svario.it>
Cc: Stephen Hemminger <stephen@networkplumber.org>, <netdev@vger.kernel.org>
Subject: Re: [iproute2 00/22] Support for stateless configuration (read from /etc and /usr)
Date: Thu, 20 Jul 2023 13:56:56 +0200	[thread overview]
Message-ID: <87v8ee7q21.fsf@nvidia.com> (raw)
In-Reply-To: <6041446f-ad4f-1b5a-9b7e-b496de080468@svario.it>


Gioele Barabucci <gioele@svario.it> writes:

> On 19/07/23 23:36, Stephen Hemminger wrote:
>> On Wed, 19 Jul 2023 20:50:44 +0200
>> Gioele Barabucci <gioele@svario.it> wrote:
>> 
>>> this patch series adds support for the so called "stateless" configuration
>>> pattern, i.e. reading the default configuration from /usr while allowing
>>> overriding it in /etc, giving system administrators a way to define local
>>> configuration without changing any distro-provided files.
>>>
>>> In practice this means that each configuration file FOO is loaded
>>> from /usr/lib/iproute2/FOO unless /etc/iproute2/FOO exists.
>> I don't understand the motivation for the change.
>
> The main, but not the only, motivation for stateless systems is explained in
>
> https://clearlinux.org/features/stateless
> https://fedoraproject.org/wiki/StatelessLinux
> https://summit.debconf.org/debconf15/meeting/276/stateless-cloud-friendly-debian/
>
> In a nutshell: to better support factory resets, shared read-only base systems, containers & Co, all
> software should work even without /etc.
>
> A nice side effect of adopting stateless-style configuration (read from /etc, fallback to /usr) is
> that it allows for distro-provided files to be strictly read-only, avoiding a bunch of common
> failures during updates and upgrades (Debian spends a huge amount of resources to correctly handle
> these so called "conffiles". The fewer, the better.)
>
>> Is /etc going away in some future version of systemd?
> This is unrelated to systemd, although systemd is probably the most well known software that uses
> this pattern.
>
>> Perhaps just using an an environment variable instead of hard coding
>> /etc/iproute2 directory.
>
> Build-time or run-time env variable?
>
> I'd say that run-time env variables (a là XDG Base Directory) are kind of hard to deal with in a
> command like `ip` that is often invoked via `sudo` (that filters and changes env in complex ways).
>
> BTW, I strongly suggest to just go with this common pattern that is now known to all sysadmins
> instead of inventing an ad-hoc way to move the default configuration away from /etc.
>
>> I do like the conslidation of the initialize_dir code though.
>
> Thanks. :)
>
> Regards,

OK, I looked at a couple bits, and the code looks reasonable overall.
I'll wait for resolution of this discussion before doing full formal
review, so as not to waste effort unnecessarily.

  reply	other threads:[~2023-07-20 11:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 18:50 [iproute2 00/22] Support for stateless configuration (read from /etc and /usr) Gioele Barabucci
2023-07-19 18:50 ` [iproute2 01/22] Makefile: Rename CONFDIR to CONF_ETC_DIR Gioele Barabucci
2023-07-19 18:50 ` [iproute2 02/22] Makefile: Add CONF_USR_DIR for system-installed configuration files Gioele Barabucci
2023-07-19 18:50 ` [iproute2 03/22] include/utils.h: Use /usr/lib/iproute2 as default CONF_USR_DIR Gioele Barabucci
2023-07-19 18:50 ` [iproute2 04/22] tc/tc_util: Read class names from provided path, /etc/, /usr Gioele Barabucci
2023-07-20 10:10   ` Petr Machata
2023-07-20 10:44     ` Gioele Barabucci
2023-07-20 11:33       ` Petr Machata
2023-07-19 18:50 ` [iproute2 05/22] tc/m_ematch: Read ematch from /etc and /usr Gioele Barabucci
2023-07-20 11:49   ` Petr Machata
2023-07-19 18:50 ` [iproute2 06/22] lib/bpf_legacy: bpf_hash_init: Relay returned value Gioele Barabucci
2023-07-19 18:50 ` [iproute2 07/22] lib/bpf_legacy: Read bpf_pinning from /etc and /usr Gioele Barabucci
2023-07-19 18:50 ` [iproute2 08/22] lib/rt_names: rtnl_hash_initialize: Relay returned value Gioele Barabucci
2023-07-19 18:50 ` [iproute2 09/22] lib/rt_names: rtnl_tab_initialize: " Gioele Barabucci
2023-07-19 18:50 ` [iproute2 10/22] lib/rt_names: Read rt_protos from /etc and /usr Gioele Barabucci
2023-07-19 18:50 ` [iproute2 11/22] lib/rt_names: Read rt_scopes " Gioele Barabucci
2023-07-19 18:50 ` [iproute2 12/22] lib/rt_names: Read rt_names " Gioele Barabucci
2023-07-19 18:50 ` [iproute2 13/22] lib/rt_names: Read rt_tables " Gioele Barabucci
2023-07-19 18:50 ` [iproute2 14/22] lib/rt_names: Read rt_dsfield " Gioele Barabucci
2023-07-19 18:50 ` [iproute2 15/22] lib/rt_names: Read group " Gioele Barabucci
2023-07-19 18:51 ` [iproute2 16/22] lib/rt_names: Read nl_protos " Gioele Barabucci
2023-07-19 18:51 ` [iproute2 17/22] lib/rt_names: Read rt_protos.d/* " Gioele Barabucci
2023-07-19 18:51 ` [iproute2 18/22] lib/rt_names: Read rt_protos.d/* using rtnl_tab_initialize_dir Gioele Barabucci
2023-07-19 18:51 ` [iproute2 19/22] lib/rt_names: Read protodown_reasons.d/* " Gioele Barabucci
2023-07-19 18:51 ` [iproute2 20/22] lib/rt_names: Read rt_tables.d/* using rtnl_hash_initialize_dir Gioele Barabucci
2023-07-19 18:51 ` [iproute2 21/22] man: Document lookup of configuration files in /etc and /usr Gioele Barabucci
2023-07-19 18:51 ` [iproute2 22/22] Makefile: Install default configuration files in /usr Gioele Barabucci
2023-07-19 21:36 ` [iproute2 00/22] Support for stateless configuration (read from /etc and /usr) Stephen Hemminger
2023-07-20  6:05   ` Gioele Barabucci
2023-07-20 11:56     ` Petr Machata [this message]
2023-07-25  1:40 ` Stephen Hemminger
2023-07-25  6:01   ` Gioele Barabucci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8ee7q21.fsf@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=gioele@svario.it \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).