oomd: implement a prekill varlink event

When a cgroup is selected for termination, send varlink messages
to hooks registered in `/run/systemd/oomd.prekill-hooks/`.
oomd waits up to `PreKillHookTimeoutSec=` seconds for response
before proceeding with the kill.
This commit is contained in:
Matteo Croce
2026-02-09 02:05:57 +01:00
parent 67cbfbbf4b
commit c1bf450fa0
13 changed files with 388 additions and 92 deletions
+2
View File
@@ -66,6 +66,8 @@
#define VARLINK_PATH_MACHINED_USERDB "/run/systemd/userdb/io.systemd.Machine"
/* Path where systemd-machined listens to resolve.hook varlink queries */
#define VARLINK_PATH_MACHINED_RESOLVE_HOOK "/run/systemd/resolve.hook/io.systemd.Machine"
/* Path where to connect to send varlink prekill events */
#define VARLINK_DIR_OOMD_PREKILL_HOOK "/run/systemd/oomd.prekill.hook/"
/* Recommended baseline - see README for details */
#define KERNEL_BASELINE_VERSION "5.14"