From: Mark Laws Date: Thu, 24 Nov 2022 05:56:29 +0000 (+0900) Subject: systemd: Default to OOMPolicy=continue for login session scopes X-Git-Tag: v253-rc1~426^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F25385%2Fhead;p=thirdparty%2Fsystemd.git systemd: Default to OOMPolicy=continue for login session scopes If the kernel OOM kills a process under a login session scope, we don't want to kill the user's other processes for no good reason. --- diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 86a5decf3f3..2ab26b9c6d4 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -3970,6 +3970,12 @@ int manager_start_scope( if (r < 0) return r; + /* For login session scopes, if a process is OOM killed by the kernel, *don't* terminate the rest of + the scope */ + r = sd_bus_message_append(m, "(sv)", "OOMPolicy", "s", "continue"); + if (r < 0) + return r; + /* disable TasksMax= for the session scope, rely on the slice setting for it */ r = sd_bus_message_append(m, "(sv)", "TasksMax", "t", UINT64_MAX); if (r < 0)