diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-02-23 10:29:52 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-03-01 09:43:23 +0100 |
commit | fdeb10b87f140f071c584deba2395e6a6aafcd11 (patch) | |
tree | 640099b6440a4fa4a90312e62a2a98062499f299 /src/portable | |
parent | 6daaeafe932c1333e083f26e72ed9b865df3f20e (diff) | |
download | systemd-fdeb10b87f140f071c584deba2395e6a6aafcd11.tar.gz |
portabled: hook up SIGRTMIN+18 and memory pressure
Diffstat (limited to 'src/portable')
-rw-r--r-- | src/portable/portabled.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/portable/portabled.c b/src/portable/portabled.c index a4fae65e7e..136c5fa191 100644 --- a/src/portable/portabled.c +++ b/src/portable/portabled.c @@ -8,6 +8,7 @@ #include "alloc-util.h" #include "bus-log-control-api.h" #include "bus-polkit.h" +#include "common-signal.h" #include "constants.h" #include "daemon-util.h" #include "main-func.h" @@ -43,6 +44,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); *ret = TAKE_PTR(m); @@ -143,7 +152,7 @@ static int run(int argc, char *argv[]) { if (argc != 1) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "This program takes no arguments."); - assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, SIGTERM, SIGINT, -1) >= 0); + assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, SIGTERM, SIGINT, SIGRTMIN+18, -1) >= 0); r = manager_new(&m); if (r < 0) |