changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / rc/bin/dontkill

changeset 7243: 34f64dcbbc25
parent: 9ddecc1751a3
author: cinap_lenrek@felloff.net
date: Fri, 17 May 2019 18:14:10 +0200
permissions: -rwxr-xr-x
description: 7l: don't hardcode 4k pagesize, use INITRND
1 #!/bin/rc
2 # dontkill regexp - mark invoker's processes with names matching regexp
3 # as not killable when the kernel runs out of memory
4 if (! ~ $#* 1) {
5  echo $0 regexp >[1=2]
6  exit usage
7 }
8 # see /sys/src/9/port/proc.c:/^killbig
9 psu | awk '$NF ~ /'$1'/ {
10 print "@{echo noswap >/proc/"$2"/ctl}"
11 }' | rc >/dev/null >[2=1]
12 exit ''