Skip to content

Instantly share code, notes, and snippets.

@sinewalker
Last active September 23, 2017 06:04
Show Gist options
  • Select an option

  • Save sinewalker/db6286eb40db4345423256514194a944 to your computer and use it in GitHub Desktop.

Select an option

Save sinewalker/db6286eb40db4345423256514194a944 to your computer and use it in GitHub Desktop.
oom-saver - cron jobs to keep essential system daemons safe from the Linux OOM killer
# keep essential system daemons safe from the OOM killer
*/1 * * * * root pgrep -f "/sbin/sshd" | while read PID; do echo -17 > /proc/$PID/oom_adj; done
*/1 * * * * root pgrep -f "/sbin/rsyslogd" | while read PID; do echo -17 > /proc/$PID/oom_adj; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment