[systemd-devel] Shipping preset files with packages to prefer socket activation
Andrea Pappacoda
andrea at pappacoda.it
Wed Jul 12 10:01:21 UTC 2023
Hi all, I'd like to ask for feedback regarding shipping a
systemd.preset(5) file with a particular software package as a way to
prefer socket activation.
To simplify things, I'm going to take the foot terminal as an example
(you can find more information about foot's systemd files here:
<https://codeberg.org/dnkl/foot/pulls/1281>), but this can apply to
other software like OpenSSH.
Foot supports a server mode which can be socket-activated, and this is
great. I'd like foot to default to socket activation when installed
from a distro package, but on distros like Debian every unit which has
an [Install] section gets enabled by default, meaning that the
foot-server.service and foot-server.socket units will be both enabled
and started by default.
To avoid enabling foot-server.service without removing the [Install]
section, I was thinking about installing a preset file alongside the
units which only specifies that foot-server.service should be disabled
by default.
While to me this looks like a simple and kinda clean solution, the
systemd.preset(5) manual page discourages shipping preset files with
software packages, as that can override distro policies; while I can
see how this applies to presets which *enable* units, I find a preset
file which only *partially disables* a service to be pretty
unobtrusive, and I don't see why it should be considered bad practice.
Am I missing anything?
In short: how can a software package which supports both traditional
and socket activation signal to the system that it prefers to be socket
activated by default?
Thanks all!
--
OpenPGP key: 66DE F152 8299 0C21 99EF A801 A8A1 28A8 AB1C EE49
More information about the systemd-devel
mailing list