diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-02-23 10:19:24 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-03-01 09:43:23 +0100 |
commit | 92e1a20998b7afa559af741ad42169252e468b26 (patch) | |
tree | 05deb9ce12b738bbc68863ebec206c6abfcdbfd0 /src/login | |
parent | 11d78c31e482146c2787ff61135d9f3cb63dad7d (diff) | |
download | systemd-92e1a20998b7afa559af741ad42169252e468b26.tar.gz |
logind: hook up memory pressure + SIGRTMIN+18
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/login/logind.c b/src/login/logind.c index 1feacd3601..a0d6cb3a27 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -14,6 +14,7 @@ #include "bus-log-control-api.h" #include "bus-polkit.h" #include "cgroup-util.h" +#include "common-signal.h" #include "constants.h" #include "daemon-util.h" #include "device-util.h" @@ -85,6 +86,14 @@ static int manager_new(Manager **ret) { if (r < 0) return r; + r = sd_event_add_signal(m->event, NULL, SIGRTMIN+18, sigrtmin18_handler, NULL); + if (r < 0) + return r; + + r = sd_event_add_memory_pressure(m->event, NULL, NULL, NULL); + if (r < 0) + log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m"); + (void) sd_event_set_watchdog(m->event, true); manager_reset_config(m); @@ -1196,7 +1205,7 @@ static int run(int argc, char *argv[]) { (void) mkdir_label("/run/systemd/users", 0755); (void) mkdir_label("/run/systemd/sessions", 0755); - assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGHUP, SIGTERM, SIGINT, SIGCHLD, -1) >= 0); + assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGHUP, SIGTERM, SIGINT, SIGCHLD, SIGRTMIN+18, -1) >= 0); r = manager_new(&m); if (r < 0) |