]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/unit.h
core: add a new unit file setting CollectMode= for tweaking the GC logic
authorLennart Poettering <lennart@poettering.net>
Mon, 13 Nov 2017 16:14:07 +0000 (17:14 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 16 Nov 2017 13:38:36 +0000 (14:38 +0100)
commit5afe510c89f26b0e721b276a0e78af914b47f0b0
tree01b4c2c06fd8c2f737313fd02b35e08c9959ff35
parent7eb2a8a1259043e107ebec94e30ed160a93f40a7
core: add a new unit file setting CollectMode= for tweaking the GC logic

Right now, the option only takes one of two possible values "inactive"
or "inactive-or-failed", the former being the default, and exposing same
behaviour as the status quo ante. If set to "inactive-or-failed" units
may be collected by the GC logic when in the "failed" state too.

This logic should be a nicer alternative to using the "-" modifier for
ExecStart= and friends, as the exit data is collected and logged about
and only removed when the GC comes along. This should be useful in
particular for per-connection socket-activated services, as well as
"systemd-run" command lines that shall leave no artifacts in the
system.

I was thinking about whether to expose this as a boolean, but opted for
an enum instead, as I have the suspicion other tweaks like this might be
a added later on, in which case we extend this setting instead of having
to add yet another one.

Also, let's add some documentation for the GC logic.
man/systemd.unit.xml
src/core/dbus-unit.c
src/core/load-fragment-gperf.gperf.m4
src/core/load-fragment.c
src/core/load-fragment.h
src/core/unit.c
src/core/unit.h
src/shared/bus-unit-util.c