[systemd-devel] /usr vs /etc for default distro units enablement
Lennart Poettering
lennart at poettering.net
Mon Dec 1 16:20:26 PST 2014
On Tue, 18.11.14 13:01, Martin Pitt (martin.pitt at ubuntu.com) wrote:
> We can certainly ship a preset of "enable *" to reflect the policy
> that in general services do get enabled by default. But this still
> leaves some issues:
No need to ship "enable *", btw. It's the implied default if no preset
file is found or no matching line is found in them. Or in other words:
the fedora default of "disable *" needs an explicit preset file, but
the Debian default of "enable *" is actually the upstream default
without preset file, too.
> * This doesn't solve the problem of having these rather uninteresting
> and cluttering symlinks in /etc at all; the wants.d symlinks would
> still be as they are now, just the place that decides when to
> enable them changes.
If they are so uninteresting that there's no real benefit in allowing
them to be modified, then I'd really recommend to simply ship the
symlinks in /usr/lib, and not include an [Install] section. A lot of
systemd's own units are like that. For example, since disabling udev
or journald will only have the effect of making your system unbootable
we don't ship [Install] sections for them, and instead hook them in
statically.
> I. e. my question is not so much about being able to restore the
> default wants.d symlinks in /etc after a factory reset -- there are
> multiple ways how this can be done: with presets or iterating over the
> installed packages and re-enabling them (Debian also does some
> house-keeping which unit files got enabled by postinstall scripts,
> which can simply be replayed).
Note that "systemctl preset-all" erally just iterates throught unit
files that are installed and individually does the equivalent of
"systemctl preset". There's little magic in there...
> I'm interested in the reason for that. This basically cements the
> status quo that one *has* to have a gazillion links in /etc in order
> for your system to work, even if they are not at all specific to the
> particular system or represent a deviation from the default install.
It's not a gazillion really. It's 15 or so on my laptop here...
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list