mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
10 lines
313 B
Bash
10 lines
313 B
Bash
#!/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
|
|
pids=`{psu | awk '$NF ~ /'$1'/ {print $2}'}
|
|
~ $#pids 0 || chmod -w /proc/^$pids^/ctl
|