Re: sysadmin configuration of sparse-/etc vs prepopulated-/etc?

2023-09-16 Thread Sam Hartman
> "Josh" == Josh Triplett  writes:

Josh> If we're talking about developing a solution that doesn't
Josh> already exist, why not have that solution *be* the
Josh> notification-and-diff/show-the-defaults mechanism you're
Josh> describing? For instance, provide a declarative mechanism to
Josh> say "this file/directory in /usr is the default version of
Josh> this configuration file in /etc", with standard schemes like
Josh> 'merge' or 'override'", and then offer a tool (similar to the
Josh> existing systemd-delta but generalized) to show all the
Josh> configuration files that differ, as well as automatic support
Josh> for flagging changes on upgrades and suggesting a three-way
Josh> merge (similar to ucf)? With some care for
Josh> convention-over-configuration, debhelper could auto-populate
Josh> this declarative data in many cases.

Yeah, I was thinking about something like this.  But I think details
about where the vendor config lives should be part of the design work.
I.E.  we could accomplish roughly the same thing by taking the files
that packages populate into /etc as the vendor config and still meet the
standard unix assumptions of a populated /etc.

There are trade offs.  If you come from the place of believing that
supporting empty /etc is valuable, then what you propose is an obvious
way forward.
If you have not accepted that value proposition, I think you may be
closing off design space by going that route.

Like Steve, I do not want to drive the discussion, but like Steve, I do
think the discussion needs to happen.
I strongly encourage those who value empty /etc to drive such a
discussion and to explain to the project why we want that.

--Sam



Re: sysadmin configuration of sparse-/etc vs prepopulated-/etc?

2023-09-15 Thread Marco d'Itri
On Sep 16, Josh Triplett  wrote:

> If we're talking about developing a solution that doesn't already exist,
> why not have that solution *be* the
> notification-and-diff/show-the-defaults mechanism you're describing? For
> instance, provide a declarative mechanism to say "this file/directory in
> /usr is the default version of this configuration file in /etc", with
This is upcoming in a future systemd release, with a new tmpfiles.d(5) 
flag adding the semantics "this rule should be only considered on the
first boot".
("first boot" is a systemd term of art which has exactly the semantics 
that we need here.)

> standard schemes like 'merge' or 'override'", and then offer a tool
> (similar to the existing systemd-delta but generalized) to show all the
> configuration files that differ, as well as automatic support for
> flagging changes on upgrades and suggesting a three-way merge (similar
> to ucf)?
This is not, but it could be added on top of it by anybody interested.

> With some care for convention-over-configuration, debhelper
> could auto-populate this declarative data in many cases.
This is intriguing. :-)

-- 
ciao,
Marco


signature.asc
Description: PGP signature


sysadmin configuration of sparse-/etc vs prepopulated-/etc?

2023-09-15 Thread Josh Triplett
Sam Hartman wrote:
> Apropos of the discussion about removing default configuration from
> /etc.
> Upstream PAM now supports doing that.  You can set up a vendor directory
> such as /usr/lib where pam.d and security live.
> 
> I thought about doing that for Debian PAM, and have decided against.
> My rationale is that I actually think dpkg gives superior handling of
> upstream configuration changes to what we'd get with the pam vendor dir
> *in the specific case of PAM*.
> 
> In particular, dpkg will let you know if the conf file has changed
> upstream and you have local changes.
> If we create a vendor directory,  you will have to diff yourself to
> discover that.
> 
> I do think that in the case of programs like systemd that do a complex
> merge of drop in fragments, the split of vendor dir from sysadmin dir
> makes a lot of sense.
[...]
> I think we might be able to find dpkg-based solutions that are superior.

If we're talking about developing a solution that doesn't already exist,
why not have that solution *be* the
notification-and-diff/show-the-defaults mechanism you're describing? For
instance, provide a declarative mechanism to say "this file/directory in
/usr is the default version of this configuration file in /etc", with
standard schemes like 'merge' or 'override'", and then offer a tool
(similar to the existing systemd-delta but generalized) to show all the
configuration files that differ, as well as automatic support for
flagging changes on upgrades and suggesting a three-way merge (similar
to ucf)? With some care for convention-over-configuration, debhelper
could auto-populate this declarative data in many cases.

One advantage of this scheme is that everyone *can* get the behavior
they want, with configuration in a single place. We could easily have a
system-wide setting for whether you want all the defaults copied to /etc
so you can edit them in-place, versus never installing any of the
defaults files and leaving /etc sparse until you populate it. And it'd
be easy and safe to toggle between the two. (This is similar to the
systemd "vendor preset" mechanism, but again, generalized.) We can, of
course, have an epic argument about which should be the *default*
behavior, but hopefully the ability for everyone to get the behavior
they prefer would make that a little less *vigorous* than usual.

On top of that, people could extend this with other mechanisms. For
instance, it'd be feasible to integrate that with something like
etckeeper, making all the base configuration files into an "upstream"
git branch that needs merging into your system's etc, and letting people
use the full power of git merging and three-way diffs to resolve issues.

Something like this would be a lot more ideal than a Debian-specific
mechanism that only supports one scheme (sparse-/etc versus
prepopulated-/etc). And it'd be more ideal than the current state that
varies from package-to-package, where people who prefer sparse-/etc are
frustrated with packages that keep defaults in /etc, and people who
prefer prepopulated-/etc are frustrated with packages that keep defaults
only in /usr and leave /etc empty.

Perhaps we could get consensus around the idea that people want the
ability to make this choice, and packages should integrate with such a
mechanism rather than choosing on a package-by-package basis?

- Josh Triplett