Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_unix/rc/bin/dontkill – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 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
cd /proc
9
# see /sys/src/9/port/proc.c:/^killbig
10
pids=`{psu | awk '$NF ~ /'$1'/ {print $2}'}
11
~ $#pids 0 || chmod -w $pids^/ctl >[2]/dev/null