[systemd-devel] run no more than one of foo at .service at a time
Johannes Ernst
johannes.ernst at gmail.com
Tue Oct 6 15:36:40 PDT 2015
> On Oct 6, 2015, at 6:19, Lennart Poettering <lennart at poettering.net> wrote:
>
> On Mon, 05.10.15 09:04, Johannes Ernst (johannes.ernst at gmail.com) wrote:
>
>> I have a foo at .service. When started as
>> systemctl start foo at abc
>> I’d like all other currently active foo@… services to stop, and vice versa. All of the foo at .services are supposed to be mutually exclusive with each other.
>>
>> In foo at .service, I attempted:
>> Conflicts: foo at .service
>> but that does not seem to do the trick (Starting foo at abc produces "Dependency Conflicts=foo at abc.service dropped”)
>>
>> I’d like to avoid having to enumerate foo at abc, foo at def etc. in the Conflicts section.
>
> Service templates are really about multi-instantiation, and explicitly
> not about enabling parameterization. That's why we only take a single
> instance identifier as parameter, and not a list of parameters, for
> example.
Good to know the principle here.
> Why wouldn't a nomral suervice suffice for your usecase, with maybe a
> few .d/ dropins to configure things differently?
That’s the kind of thing I will probably do.
Thanks,
Johannes.
More information about the systemd-devel
mailing list