Sujet : Re: systemd controversy
De : flexibeast (at) *nospam* gmail.com (Alexis)
Groupes : comp.lang.adaDate : 21. Mar 2024, 02:06:11
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87msqs78jw.fsf@gmail.com>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Gnus/5.13 (Gnus v5.13)
Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
systemd service definitions let you state dependencies between services.
Furthermore, it separates them into ordering dependencies versus
requirement dependencies.
>
E.g. an application that uses a MariaDB database requires MariaDB to be
running before it can be started (ordering + requirement dependency).
>
An application that can (but doesn’t have to) make use of network services
should be started after the network stack is up (ordering dependency).
>
I’m not aware of any other service-management system that provides this
level of control.
s6 supports both dependency management and readiness notification:
https://skarnet.org/software/s6/overview.htmls6 is the basis for 66, used for service management by Obarun, an
Arch-based distro:
https://wiki.obarun.org/doku.php?id=66introWhen i was running Void as my daily driver, i was using 66 for service
management. (And not runit, which doesn't have true support for
dependencies; kludges are required.)
The s6 site has a page discussing "socket activation":
https://skarnet.org/software/s6/socket-activation.htmlOpenRC supports integration with s6, and OpenRC itself provides
dependency management; cf. this excerpt from the openrc-run(8) man
page:
You should define a depend function for the service so that openrc-run
will start and stop it in the right order in relation to other
services. As it's a function it can be very flexible, see the example
below. Here is a list of the functions you can use in a depend
function. You simply pass the names of the services you want to add to
that dependency type to the function, or prefix the names with ! to
remove them from the dependencies.
>
need
The service will attempt to start any services it needs regardless of
whether they have been added to the runlevel. It will refuse to start
until all services it needs have started, and it will refuse to stop
until all services that need it have stopped.
>
use
The service will attempt to start any services it uses that have been
added to the runlevel.
>
want
The service will attempt to start any services it wants, regardless of
whether they have been added to the runlevel.
>
after
The service will start after these services and stop before these services.
>
before
The service will start before these services and stop
after these services.
>
provide
The service provides this virtual service. For example, named provides
dns. Note that it is not legal to have a virtual and real service
with the same name. If you do this, you will receive an error message,
and you must rename either the real or virtual service.
There's also dinit, which i don't have any direct experience of; here's
a page by the author, comparing it to other systems:
https://github.com/davmac314/dinit/blob/master/doc/COMPARISON(And of course, since cgroups is distinct from systemd, it can be
utilised by any init / supervision / service management system.)
Alexis.