08.07.2016 22:01, Lennart Poettering пишет:
> On Fri, 01.07.16 06:37, Andrei Borzenkov (arvidj...@gmail.com) wrote:
> 
>> In principle, I do not see why we cannot have WantedBy and RequiredBy as
>> first class directives under [Unit] to spare all these hoops.
> 
> systemd loads unit files as they are requested, by following
> dependencies. i.e. when we see Wants=foobar.service in a file
> quux.service, and quux.service is loaded because it shall be started
> then we'll load foobar.service too. systemd does not load unit files
> that are not referenced by any other unit. It hence minimizes what it
> loads, and it does *not* iterate through the unit dirs loading
> everything it finds there.
> 
> Now, if we would permit WantedBy= in [Unit], this would mean that if a
> unit file waldo.service carries WantedBy=miau.service in [Unit], then
> when miau.service is requested to be started we would somehow have to
> determine that waldo.service is to be loaded and started too. But how
> could we do that without loading all possible unit files as boot? i
> mean, how would we efficiently detect that waldo.service needs to be
> loaded when just looking at miau.service if the latter does not carry
> in anyway information about the former?
> 

I see, yes, I did not consider it. Thank you for explanation.
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to