]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: run user service managers at OOM score adjustment 100
authorLennart Poettering <lennart@poettering.net>
Thu, 30 Sep 2021 09:23:32 +0000 (11:23 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 4 Oct 2021 14:27:10 +0000 (16:27 +0200)
Let's make it slightly more likely that a per-user service manager is
killed than any system service. We use a conservative 100 (from a range
that goes all the way to 1000).

Replaces: #17426

Together with the previous commit this means: system manager and system
services are placed at OOM score adjustment 0 (specifically: they
inherit kernel default of 0). User service manager (both for root and
non-root) are placed at 100. User services for non-root are placed at
200, those for root inherit 100.

Note that processes forked off the user *sessions* (i.e. not forked off
the per-user service manager) remain at 0 (e.g. the shell process
created by a tty or ssh login). This probably should be
addressed too one day (maybe in pam_systemd?), but is not covered here.

units/user@.service.in

index fec9afe1305e92731814f56677e26f0de778925f..85fc3c907e238f5212b4b7d15d06b4bfe9d17ba1 100644 (file)
@@ -25,3 +25,4 @@ Delegate=pids memory
 TasksMax=infinity
 TimeoutStopSec=120s
 KeyringMode=inherit
+OOMScoreAdjust=100