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

Damien Robert damien.olivier.robert at gmail.com
Wed Oct 8 23:12:50 PDT 2014


>From Lennart Poettering, Wed 08 Oct 2014 at 23:33:13 (+0200) :
> On Fri, 03.10.14 19:18, Damien Robert (damien.olivier.robert at gmail.com) wrote:
> > > 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?
> No, we enumerate the installed unit files, and then look them up in
> the preset files. 

Yes, I meant you can't do the otherway around anyway (enumerate lines in
preset files and enable/disable them accordingly) because the preset
information is given by globs.
 
> 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?

For preset-all:
- I may want to enable an instance different from the default instance.
  For example wpa_supplicant at .service does not have a default instance.
  (I could change the file but in this case I might as well write directly
  a non template service file)
- I may want to enable different instances of the same template file.
- disable * does not disable instanciated templates (except the ones with a
  default instance).

But as you said, I do not see an easy way to do that the way preset-all
works.

Damien

-- 
Damien Robert
http://www.normalesup.org/~robert/pro


More information about the systemd-devel mailing list