Re: Limits in the kernel

Adam Sulmicki (adam@cfar.umd.edu)
Mon, 22 Jun 1998 14:15:09 -0400


Rik van Riel writes:
->On Sun, 21 Jun 1998, J'aime Fournier wrote:
->
->> Well you could lower the MAX_TASKS_PER_USER in
->> /usr/src/linux/include/tasks.h
->> To somethine more reasonable like 50 or so.
->> The default is 256.
->>
->> I have a patch I made to setup a /proc/secure/maxtasks
->> Using sysctl to change the MAX_TASKS_PER_USER on the fly.
->
->Note that you may want to run more processes for
->priviledged users like root, mail, news, http...

Ugh, is it just me? What's wrong with :

[root@eax log]# man -k setrlimit | cat
getrlimit, getrusage, setrlimit (2) - get/set resource limits and usage

And practical implemnation of it in bash (man bash, search for
ulimit)

And an exampe of implemenation of it for bash,

[from /etc/profile]
tty -s
if [ $? -eq 0 ]; then
echo "#########"
/usr/games/fortune -s -n 300
echo "#########"
if [ `id -u` -gt 499 ]; then
ulimit -d 2000
ulimit -m 2000
ulimit -s 2000
ulimit -u 50
renice +5 $$
fi
fi

[note in this example those are soft not hard limits, but
hard limits should work as well]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu