On Mon, 27.06.16 08:25, Paul Menzel (paulepan...@users.sourceforge.net) wrote:

> Dear systemd folks,
> 
> 
> having a template for a service unit like `example@.service`, and
> starting several services from it, is there a way, to let another
> service unit require all services started from that template?

Well, what does "all instances" even mean? Note that instances can be
instantiated dynamically. i.e. without having a unit file
foo@bar.service on disk you can simply by having foo@.service on disk
make "systemctl start foo@bar.service" work. Hence, if you want some
other service to have deps onto "all" instances of foo@.service, then
this would mean you'd have to add deps for really all theoretically
possible instance strings, and those are quite a few...

Now, what would make more sense if by "all" you just mean "all *enabled*
instances". if that's what you mean then RequiredBy= in [Install]
should do what you need.

Alternatively, if by "all" you mean "all *running" instances", then
you could use PartOf= in the instance unit file instead of
Requires=. The effective difference is that only stops are propagated,
but not starts.

Hope this makes some sense,

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to