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

Colin Guthrie gmane at colin.guthr.ie
Thu Oct 2 08:28:27 PDT 2014


Lennart Poettering wrote on 02/10/14 15:48:
> On Thu, 02.10.14 16:36, Damien Robert (damien.olivier.robert at gmail.com) wrote:
> 
>> >From Lennart Poettering, Thu 02 Oct 2014 at 16:07:03 (+0200) :
>>> How precisely would you envision this to work? I mean, so far
>>> "systemctl preset foo at bar.service" will precisely enable
>>> "foo at bar.service"
>>
>> That's exactly what I want; I have not tried systemctl preset
>> foo at bar.service, but in 'systemctl preset-all' it does not work (it only
>> enables services that exist, not instanciated service).
> 
> 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?

Would it be possible for the .preset file to just specify foo at .service
and then the code that actually enables it just process the
DefaultInstance rule as normal?

As you mentioned earlier, the [Install] section cannot be overridden via
drop-ins, but shouldn't systemctl preset-all honour DefaultInstance=
directive properly without having to duplicate that info into a .preset
file?

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list