mirror of
https://github.com/systemd/systemd.git
synced 2025-02-22 09:57:34 +03:00
oomd: force DefaultMemoryPressureDurationSec= to be greater than or equal 1 sec
This commit is contained in:
parent
14140b3544
commit
a858355e4a
@ -81,7 +81,7 @@
|
||||
<listitem><para>Sets the amount of time a unit's control group needs to have exceeded memory pressure
|
||||
limits before <command>systemd-oomd</command> will take action. Memory pressure limits are defined by
|
||||
<varname>DefaultMemoryPressureLimit=</varname> and <varname>ManagedOOMMemoryPressureLimit=</varname>.
|
||||
Defaults to 30 seconds when this property is unset or set to 0.</para></listitem>
|
||||
Must be set to 0, or at least 1 second. Defaults to 30 seconds when unset or 0.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
@ -155,6 +155,9 @@ static int run(int argc, char *argv[]) {
|
||||
|
||||
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, -1) >= 0);
|
||||
|
||||
if (arg_mem_pressure_usec > 0 && arg_mem_pressure_usec < 1 * USEC_PER_SEC)
|
||||
log_error_errno(SYNTHETIC_ERRNO(EINVAL), "DefaultMemoryPressureDurationSec= must be 0 or at least 1s");
|
||||
|
||||
r = manager_new(&m);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to create manager: %m");
|
||||
|
Loading…
x
Reference in New Issue
Block a user