Chris Nelson wrote:
> > > I'm running Linux 2.0.34 on a Dual Pentium 200, setting the max cpu time
> > > for a user doesn't seem to work, does anyone know if this is supported by
> > > 2.0.x linux kernels?
> >
> > It works fine on 2.0.35 at least.
> >
> > Typing `ulimit -t 1' and then running a CPU-intensive application
> > results in it dying quite quickly.
>
> How do you set this FOR a user, I tried putting
> if [ "$USER" = "bob"] then ;
> ulimit ...
> fi
>
> in /etc/profile but it didn't seem to work it set the limits but then they
> didn't stay. Any Ideas?
If you want to *restrict* users' resource usage (as opposed to just
helping them to guard against runaway processes), then:
a) You need to set hard limits (with `ulimit -H ...'). A user can
increase a soft limit.
b) You need to ensure that the ulimit command is executed. If a user
sets their shell to e.g. tcsh, or they arrange for commands to be run
via cron, ~/.forward etc, the contents of /etc/profile won't have any
effect.
Having said that, once a limit is set, it is inherited by all child
processes (hence the use of /etc/initscript).
--
Glynn Clements <[EMAIL PROTECTED]>