]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/dontkill
crop /lib/face/48x48x8/n/nixie.1 to the right size (was 512x512)
[plan9front.git] / rc / bin / dontkill
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 c="/proc/"$2"/ctl"
11 print "chmod +w "c
12 print "@{echo noswap >"c"}"
13 print "chmod -w "c
14 }' | rc >/dev/null >[2=1]