ref: f7a296922b2616ddd5c3d753d4f0f165a2ea5215
dir: /rc/bin/dontkill/
#!/bin/rc # dontkill regexp - mark invoker's processes with names matching regexp # as not killable when the kernel runs out of memory if (! ~ $#* 1) { echo $0 regexp >[1=2] exit usage } # see /sys/src/9/port/proc.c:/^killbig psu | awk '$NF ~ /'$1'/ { print "@{echo noswap >/proc/"$2"/ctl}" }' | rc >/dev/null >[2=1] exit ''