<p dir="ltr"><br>
On Jun 14, 2014 11:55 AM, "Colin Walters" <<a href="mailto:walters@verbum.org">walters@verbum.org</a>> wrote:<br>
><br>
> On Fri, Jun 13, 2014, at 12:35 PM, Michael Marineau wrote:<br>
> ><br>
> > For what its worth, in my efforts to make CoreOS boot with a<br>
> > completely empty root filesystem I found that the changes required<br>
> > were usually not too dramatic. Fixing many packages, like sudo, just<br>
> > amounted to shipping different config files and adding<br>
> > --sysconfdir=/usr/share to ./configure at build time. For dbus it only<br>
> > takes that configure option plus a update to session.conf and<br>
> > system.conf to support both /usr/share/dbus-1 and /etc/dbus-1 for<br>
> > configs:<br>
> > <a href="https://github.com/coreos/coreos-overlay/blob/master/sys-apps/dbus/files/dbus-1.6.x-add-explicit-etc-path.patch">https://github.com/coreos/coreos-overlay/blob/master/sys-apps/dbus/files/dbus-1.6.x-add-explicit-etc-path.patch</a><br>

><br>
> Interesting.  A clean patch might be worth submitting upstream to dbus<br>
> for this, i.e. one where it just automatically reads<br>
> /usr/share/dbus-1/config or so, supporting overrides in /etc.  I don't<br>
> think you'd find anyone today who would defend the current dbus XML and<br>
> policy layout, but then again, it was designed in 2001-2002.<br>
><br>
> It also predates PolicyKit, and back then the thought was that admins<br>
> might have to edit the XML to e.g. disallow users from accessing<br>
> NetworkManager type services.<br>
><br>
> I know kdbus is on the horizon, but there'll be services installing<br>
> policy files there for quite a while, and it would make sense to move<br>
> the ones that really don't have any reason to be configured by admins,<br>
> which at least on my workstation is most of them.<br>
><br>
> > Where new code is required it is similarly not very complicated, to<br>
> > support reading account information, services, hosts, and other nss<br>
> > data files we have a small project that is just a strait-up copy of<br>
> > the files nss module from glibc with some hard coded paths changed to<br>
> > configurable macros. <a href="https://github.com/coreos/nss-altfiles">https://github.com/coreos/nss-altfiles</a><br>
><br>
> Right.  I think nss-altfiles won't be needed anymore potentially if this<br>
> systemd scheme works out.<br>
><br>
> > So working through all these details is a damn tedious task and I<br>
> > don't doubt it could be years before we and others get around to<br>
> > getting good support for reading configuration from both /usr and /etc<br>
> > into upstream packages. The good news is that while we bang out the<br>
> > best way to implement this the changes aren't any weirder than the<br>
> > patches and hacks that distros typically have to do when integrating<br>
> > packages.<br>
><br>
> Mmmm...I'd say configuring with --sysconfdir=/usr/share is definitely an<br>
> unusual hack =)<br>
><br>
> > As a side note, regardless of whether an empty /etc is actually viable<br>
> > or not the more packages that support gracefully dealing with<br>
> > configuration in both /etc and /usr the fewer files there will be in<br>
> > /etc that are in the awkward position of being managed by both users<br>
> > and packages.<br>
><br>
> systemd has an excellent implementation of this, with a substantial<br>
> amount of tooling on top.  "systemd-delta" is quite cool.  But it<br>
> requires a lot of though to integrate for various projects, because you<br>
> have to carefully think about what should be the defaults, and how the<br>
> system administrator can override.<br>
><br>
> For example, if you have default sudo configuration in /usr/share, is<br>
> there a way an admin can mask that?  I think from your patch you<br>
> generate a symlink they can unlink?</p>
<p dir="ltr">The sudo setup is a little different but in most cases where packages depend on configs in /etc they are provided as symlinks that can be replaced in place by a file. Simply removing the symlink likely breaks the affected package so the link will be recreated on the next boot by systemd-tmpfiles. I only consider this a short term solution, a missing config should mean "use defaults" not "omg crash" which is the typical behavior. :(</p>

<p dir="ltr">><br>
> > rpm and dpkg's behavior of just picking one and backing<br>
> > up the other or gentoo's scheme of forcing users to wade through 3-way<br>
> > diffs are all pretty terrible.<br>
><br>
> Yes: <a href="http://blog.verbum.org/2014/01/24/why-ostree-requires-usretc/">http://blog.verbum.org/2014/01/24/why-ostree-requires-usretc/</a><br>
><br>
> > If packages did their best to avoid<br>
> > installing files to /etc, giving users exclusive control over that<br>
> > space, everyone wins. :)<br>
><br>
> I agree cleanup in this area makes a ton of sense; if more projects<br>
> worked like systemd the world would be better.  But there's a large gap<br>
> between --sysconfdir=/usr/share/ and systemd's implementation.</p>
<p dir="ltr">Agreed, but got to start somewhere!<br>
</p>