#include <getopt.h>
+#include "build.h"
#include "bus-log-control-api.h"
#include "bus-object.h"
#include "cgroup-util.h"
#include "conf-parser.h"
#include "daemon-util.h"
+#include "fileio.h"
#include "log.h"
#include "main-func.h"
-#include "oomd-manager.h"
#include "oomd-manager-bus.h"
+#include "oomd-manager.h"
#include "parse-util.h"
-#include "pretty-print.c"
+#include "pretty-print.h"
#include "psi-util.h"
#include "signal-util.h"
{}
};
- return config_parse_many_nulstr(PKGSYSCONFDIR "/oomd.conf",
- CONF_PATHS_NULSTR("systemd/oomd.conf.d"),
- "OOM\0",
- config_item_table_lookup,
- items,
- CONFIG_PARSE_WARN,
- NULL,
- NULL);
+ return config_parse_standard_file_with_dropins(
+ "systemd/oomd.conf",
+ "OOM\0",
+ config_item_table_lookup, items,
+ CONFIG_PARSE_WARN,
+ /* userdata= */ NULL);
}
static int help(void) {
_cleanup_free_ char *link = NULL;
int r;
- r = terminal_urlify_man("systemd-oomd", "1", &link);
+ r = terminal_urlify_man("systemd-oomd", "8", &link);
if (r < 0)
return log_oom();
r = safe_atollu(swap, &s);
if (r < 0 || s == 0)
- log_warning("Swap is currently not detected; memory pressure usage will be degraded");
+ log_warning("No swap; memory pressure usage will be degraded");
if (!is_pressure_supported())
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "Pressure Stall Information (PSI) is not supported");
if (!FLAGS_SET(mask, CGROUP_MASK_MEMORY))
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "Requires the cgroup memory controller.");
- assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, -1) >= 0);
+ assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT) >= 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");
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "DefaultMemoryPressureDurationSec= must be 0 or at least 1s");
r = manager_new(&m);
if (r < 0)