summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-02-21 15:53:38 +0000
committerSimon McVittie <smcv@collabora.com>2022-02-22 19:26:55 +0000
commitc42bb64457c3b31e561ad9885c618e051af1171a (patch)
treecfb368504672b1f99ae5a6efa41fd7941554e1dd /bus
parentf3ffe9a873708c679df88b9fc12b6b831539cf8a (diff)
downloaddbus-c42bb64457c3b31e561ad9885c618e051af1171a.tar.gz
spawn-unix: On Linux, don't try to increase OOM-killer protection
The oom_score_adj parameter is a signed integer, with increasingly positive values being more likely to be killed by the OOM-killer, and increasingly negative values being less likely. Previously, we assumed that oom_score_adj would be negative or zero, and reset it to zero, which does not require privileges because it meant we're voluntarily giving up our OOM-killer protection. In particular, bus/dbus.service.in has OOMScoreAdjust=-900, which we don't want system services to inherit. However, systemd >= 250 has started putting a positive oom_score_adj on user processes, to make it more likely that the OOM killer will kill a user process rather than a system process. Changing from a positive oom_score_adj to zero is increasing protection from the OOM-killer, which only a privileged process is allowed to do, resulting in warnings whenever we carry out traditional (non-systemd) service activation on the session bus. To avoid this, do the equivalent of: if (oom_score_adj < 0) oom_score_adj = 0; which is always allowed. Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/374 Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'bus')
0 files changed, 0 insertions, 0 deletions