On Tue, Nov 30, 2021 at 07:13:45AM +0100, Martin Pitt wrote:
Stephen Gallagher [2021-11-29 14:34 -0500]:
> Alexander: Does samba have a drop-file configuration anywhere? So we
> could specify `include = registry` when this Cockpit plugin is
> installed, but not otherwise?
IMHO this is generally not a good idea. Merely installing a (mostly
unrelated) package should not unexpectedly reconfigure existing running
services. The docs [1] don't really clarify the impact, but at least the
"automatically activates registry shares" sounds like possibly unexpected
fallout, and may violate the "least surprise" principle?
I think the alternative would be for the Cockpit plugin to, instead of
telling users to edit the config file by hand, have a button to _just do
it_. I don't like munging config files, though (so fragile!), so:
It looks from
https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#INCLUDE
that although it doesn't have a drop-in file option, the include option
_normally_ means "literally include a file here as though typed in place",
and for some probably-too-clever-but-oh-well reason, "include = registry"
has a special meaning.
I can think of several things we could do with this, but if we don't want
surprising behavior, we could have [global] include
include = /etc/samba/cockpit.conf
in the standard package. I don't know how samba behaves if files are
missing, but if it doesn't cause errors, that file could just be not there
by default. Or, if it needs to have something, could just contain a
commment. Then, the Cockpit tool could then replace just that file
(either directly or with a symlink) when you press a button. (Samba server
doesn't start by default, so that button could also enable the service?)
--
Matthew Miller
<mattdm(a)fedoraproject.org>
Fedora Project Leader