core: add a new setting DefaultOOMScoreAdjust= and set it to 100 above service manager's by default
Let's make our service managers slightly less likely to be killed by the OOM killer by adjusting our services' OOM score adjustment to 100 above ours. Do this conservatively, i.e. only for regular user sessions.
This commit is contained in:
@@ -187,6 +187,11 @@ static void unit_init(Unit *u) {
|
||||
if (ec) {
|
||||
exec_context_init(ec);
|
||||
|
||||
if (u->manager->default_oom_score_adjust_set) {
|
||||
ec->oom_score_adjust = u->manager->default_oom_score_adjust;
|
||||
ec->oom_score_adjust_set = true;
|
||||
}
|
||||
|
||||
if (MANAGER_IS_SYSTEM(u->manager))
|
||||
ec->keyring_mode = EXEC_KEYRING_SHARED;
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user