Linux: Run all child processes in their own systemd scope to prevent the OOM killer from harvesting kitty when a child process misbehaves

Fixes #7427
This commit is contained in:
Kovid Goyal
2024-05-16 15:43:25 +05:30
parent 3345e40bdb
commit 39ea084be9
7 changed files with 180 additions and 0 deletions

View File

@@ -499,6 +499,7 @@ extern bool init_logging(PyObject *module);
extern bool init_png_reader(PyObject *module);
extern bool init_utmp(PyObject *module);
extern bool init_loop_utils(PyObject *module);
extern bool init_systemd_module(PyObject *module);
#ifdef __APPLE__
extern int init_CoreText(PyObject *);
extern bool init_cocoa(PyObject *module);
@@ -570,6 +571,7 @@ PyInit_fast_data_types(void) {
if (!init_utmp(m)) return NULL;
if (!init_loop_utils(m)) return NULL;
if (!init_crypto_library(m)) return NULL;
if (!init_systemd_module(m)) return NULL;
CellAttrs a;
#define s(name, attr) { a.val = 0; a.attr = 1; PyModule_AddIntConstant(m, #name, shift_to_first_set_bit(a)); }