Skip to content

Instantly share code, notes, and snippets.

@rctay
Last active December 29, 2015 17:29
Show Gist options
  • Save rctay/7704692 to your computer and use it in GitHub Desktop.
Save rctay/7704692 to your computer and use it in GitHub Desktop.
tmux: disqualify from oom-killer (I really should look into tmux conf files)

After running the command, you'll now be in your tmux session, in copy mode, with the contents

echo \-17 | sudo tee /proc/1234/oom_adj

You can then copy this, exit copy mode, paste and execute.

Note: in Ubuntu Raring tmux 1.7-3, copying the line caused a crash.

tmux new-session\
\; set-window-option -g mode-key vi\
\; run-shell "tmux server-info"\
"| head -n1 "\
"| grep -Po '(?<=^tmux 1.\d, pid )(\d+)'"\
"| awk '{print \"echo \\-17 | sudo tee /proc/\"\$1\"/oom_adj\"}'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment