]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/scope.c
core: move initialization of -.slice and init.scope into the unit_load() callbacks
authorLennart Poettering <lennart@poettering.net>
Mon, 24 Oct 2016 18:37:54 +0000 (20:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Oct 2016 18:46:30 +0000 (20:46 +0200)
commit8e4e851f1ddc98daf69b68998afc5a096ea17893
tree0e33b1646c5638df78030bdf1e44e77f72f5b8a6
parent229ba9fd57942fb7d1bb738ab1ad21356431d952
core: move initialization of -.slice and init.scope into the unit_load() callbacks

Previously, we'd synthesize the root slice unit and the init scope unit in the
enumerator callbacks for the unit type. This is problematic if either of them
is already referenced from a unit that is loaded as result of another unit
type's enumerator logic.

Let's clean this up and simply create the two objects from the enumerator
callbacks, if they are not around yet. Do the actual filling in of the settings
from the unit_load() callbacks, to match how other units are loaded.

Fixes: #4322
src/core/scope.c
src/core/slice.c