Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/dontkill/dontkill.new

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/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

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.