[systemd-devel] [RFC] [PATCH] core: avoid duplicate unit property set
Lennart Poettering
lennart at poettering.net
Mon Dec 8 07:08:37 PST 2014
On Mon, 08.12.14 15:12, WaLyong Cho (walyong.cho at samsung.com) wrote:
> Currently, unit property set apis set unit property and also make a
> dropin files in each dbus-xyz.c. And the dropin will set its
> properties again in unit_load().
> So don't need to set property immediatly. That will be set next
> unit_load(). Just write dropin files only.
Well, we there are two kinds of options currently:
a) the ones you can change any time, using "systemctl
set-property". Primarily these are cgroup options to change
resource controls during runtime. When "systemctl set-property" is
invoked, then the changes should be instantly applied.
b) The ones you can only change when creating a transient unit, which
cannot be changed later on with "systemctl set-property".
Now, both kinds of properties can be set when creating transient
units, but only the properties of type (a) can be altered after
creating the units using "systemctl set-property".
Now, unit_load() is only invoked when we create units, or on
"systemctl daemon-reload". We write the drop-in snippets for these
cases. However, we also want to allow the properties of type (a) to be
effective *without* actually waiting for unit_load(), they should
apply instantly, hence we apply them also directly, without
unit_load().
Hope this makes sense?
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list