diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-03-19 19:05:19 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-04-09 11:17:58 +0200 |
commit | afcfaa695cd00b713e7d57e1829da90b692ac6f8 (patch) | |
tree | 0f0394e7d37d4fbcdcc792cb00d22a2de1df0fc3 /src/core/dbus-manager.h | |
parent | a5b5aece01f677ba59ca43001c85b722388fd67f (diff) | |
download | systemd-afcfaa695cd00b713e7d57e1829da90b692ac6f8.tar.gz |
core: implement OOMPolicy= and watch cgroups for OOM killings
This adds a new per-service OOMPolicy= (along with a global
DefaultOOMPolicy=) that controls what to do if a process of the service
is killed by the kernel's OOM killer. It has three different values:
"continue" (old behaviour), "stop" (terminate the service), "kill" (let
the kernel kill all the service's processes).
On top of that, track OOM killer events per unit: generate a per-unit
structured, recognizable log message when we see an OOM killer event,
and put the service in a failure state if an OOM killer event was seen
and the selected policy was not "continue". A new "result" is defined
for this case: "oom-kill".
All of this relies on new cgroupv2 kernel functionality: the
"memory.events" notification interface and the "memory.oom.group"
attribute (which makes the kernel kill all cgroup processes
automatically).
Diffstat (limited to 'src/core/dbus-manager.h')
-rw-r--r-- | src/core/dbus-manager.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/dbus-manager.h b/src/core/dbus-manager.h index d0306adc70..10aa2eccee 100644 --- a/src/core/dbus-manager.h +++ b/src/core/dbus-manager.h @@ -12,3 +12,5 @@ void bus_manager_send_reloading(Manager *m, bool active); void bus_manager_send_change_signal(Manager *m); int verify_run_space_and_log(const char *message); + +int bus_property_get_oom_policy(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *ret_error); |