Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-30 Thread Marc Haber
Hi, On Wed, Jul 30, 2025 at 08:28:34PM +0100, Barry Scott wrote: On 30 Jul 2025, at 09:00, Marc Haber wrote: I find the entire Before/After and Wants/Requires incredibly powerful but also hard to grasp. I am not a newbie to systemd but this is something that I have not fully understood yet.

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-30 Thread Barry Scott
> On 30 Jul 2025, at 09:00, Marc Haber wrote: > > I find the entire Before/After and Wants/Requires incredibly powerful but > also hard to grasp. I am not a newbie to systemd but this is something that I > have not fully understood yet. The description in `man systemd.unit` seem to describe

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-30 Thread Andrei Borzenkov
30.07.2025 11:00, Marc Haber wrote: Hi, On Wed, Jul 30, 2025 at 07:31:56AM +0300, Andrei Borzenkov wrote: 29.07.2025 11:30, Marc Haber wrote: Hi, I have a template service unit which runs a oneshot service that generates both high CPU and high I/O load for a couple of minutes. The service is

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-30 Thread Marc Haber
Hi, On Wed, Jul 30, 2025 at 07:31:56AM +0300, Andrei Borzenkov wrote: 29.07.2025 11:30, Marc Haber wrote: Hi, I have a template service unit which runs a oneshot service that generates both high CPU and high I/O load for a couple of minutes. The service is templated a couple of times and runs

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Andrei Borzenkov
29.07.2025 11:30, Marc Haber wrote: Hi, I have a template service unit which runs a oneshot service that generates both high CPU and high I/O load for a couple of minutes. The service is templated a couple of times and runs from an, also templated timer. In another use case, I have independent

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Nils Kattenbeck
> > That being said, I currently don't make much sense from this future > documentation. Would I need to refer to all my service units in my > .slice file or can a service assign itself to a slice from its own unit? > You can specify a slice using the Slice= property under [Service] and IIRC templ

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Barry
> On 29 Jul 2025, at 10:58, Marc Haber wrote: > > Wouldnt that make them just start all at once? The opposite; one After= the other. I assume they are type=oneshot. Remember that After= etc do not cause a unit to run for that you use Require= etc. Barry

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Marc Haber
On Tue, Jul 29, 2025 at 11:05:38AM +0100, Luca Boccassi wrote: https://www.freedesktop.org/software/systemd/man/devel/systemd.slice.html#ConcurrencySoftMax= That looks really interesting. Sadly, my favorite distribution will release its next stable version in two weeks with systemd 257, so thi

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Nils Kattenbeck
Hi, the most idiomatic approach is likely to use the new concurrency limits for slices which will be release with the upcoming v258: https://www.freedesktop.org/software/systemd/man/devel/systemd.slice.html#ConcurrencyHardMax= Otherwise if the set of templated units is fixed and the order is arbi

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Luca Boccassi
On Tue, 29 Jul 2025 at 11:00, Marc Haber wrote: > > Hi, > > I have a template service unit which runs a oneshot service that > generates both high CPU and high I/O load for a couple of minutes. The > service is templated a couple of times and runs from an, also templated > timer. > > In another us

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Marc Haber
On Tue, Jul 29, 2025 at 10:20:31AM +0100, Barry Scott wrote: Is it possible to use After= or Before= in template services to order them? Wouldnt that make them just start all at once? Greetings Marc -- - Marc Haber

Re: [systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Barry Scott
> On 29 Jul 2025, at 09:30, Marc Haber wrote: > > Hi, > > I have a template service unit which runs a oneshot service that generates > both high CPU and high I/O load for a couple of minutes. The service is > templated a couple of times and runs from an, also templated timer. > > In anothe

[systemd-devel] How to lock two instances of a templated service against each other

2025-07-29 Thread Marc Haber
Hi, I have a template service unit which runs a oneshot service that generates both high CPU and high I/O load for a couple of minutes. The service is templated a couple of times and runs from an, also templated timer. In another use case, I have independent services that generate high CPU