mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Add support for spawning panes in separate cgroups with systemd and a configure
flag to disable. From Eric T Johnson yut23 AT gvljohnsons DOT com in GitHub issue 3514.
This commit is contained in:
14
spawn.c
14
spawn.c
@ -380,8 +380,20 @@ spawn_pane(struct spawn_context *sc, char **cause)
|
||||
}
|
||||
|
||||
/* In the parent process, everything is done now. */
|
||||
if (new_wp->pid != 0)
|
||||
if (new_wp->pid != 0) {
|
||||
#if defined(HAVE_SYSTEMD) && defined(ENABLE_CGROUPS)
|
||||
/*
|
||||
* Move the child process into a new cgroup for systemd-oomd
|
||||
* isolation.
|
||||
*/
|
||||
if (systemd_move_pid_to_new_cgroup(new_wp->pid, cause) < 0) {
|
||||
log_debug("%s: moving pane to new cgroup failed: %s",
|
||||
__func__, *cause);
|
||||
free (*cause);
|
||||
}
|
||||
#endif
|
||||
goto complete;
|
||||
}
|
||||
|
||||
/*
|
||||
* Child process. Change to the working directory or home if that
|
||||
|
Reference in New Issue
Block a user