[systemd-devel] [feature request] allow instances in file.preset

Lennart Poettering lennart at poettering.net
Wed Oct 8 14:33:13 PDT 2014


On Fri, 03.10.14 19:18, Damien Robert (damien.olivier.robert at gmail.com) wrote:

> >From Lennart Poettering, Thu 02 Oct 2014 at 16:48:19 (+0200) :
> > Well, but from somewhere systemctl preset-all needs to be able to
> > discover the "bar" string... How is that supposed to work?
> > 
> > preset-all just enumerates all unit files that are installed and
> > enables/disables them according to the preset file. But this means it
> > would only find the template, and the instance would have to come from
> > somewhere else, but where?
> 
> From the preset file? I agree that since the enable/disable directive
> denotes glob, they are not well suited for instances services. Maybe
> add a

No, we enumerate the installed unit files, and then look them up in
the preset files. 

> new directive:
> instanciate foo at bar.service
> uninstanciate foo at bar.service
> (the uninstanciate is because disable does not disable instancied service
> for the same reason enable doe not enable them).
> 
> I do not feel too strongly on this feature, afterwards it might as well be
> easier to call systemctl enable directly...

I have the impression that the current scheme already does everything
what you need, no?

I mean, if you list the template unit file in the preset file, and we
enumerate such a template unit file, we end up enabling it's
DefaultInstance=, which should be enough for you? Or am I missing
something?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list