From owner-freebsd-questions Fri May 30 11:14:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA29874 for questions-outgoing; Fri, 30 May 1997 11:14:03 -0700 (PDT) Received: from super-g.inch.com (super-g.com [204.178.32.161]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA29866 for ; Fri, 30 May 1997 11:14:00 -0700 (PDT) Received: from localhost (spork@localhost) by super-g.inch.com (8.8.5/8.6.9) with SMTP id OAA25351; Fri, 30 May 1997 14:28:24 GMT Date: Fri, 30 May 1997 14:28:24 +0000 (GMT) From: spork X-Sender: spork@super-g.inch.com To: Zahemszky Gabor cc: iFreeBSD questions Subject: Re: nice In-Reply-To: <199705281425.QAA00376@CoDe.hu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk It also seems the 2.2 login.conf file could help here; just make a certain class of users and impose limits there... Charles On Wed, 28 May 1997, Zahemszky Gabor wrote: > > On Tue, 27 May 1997, Wayne Baety wrote: > > > > > > > > Is there a way to have all of a users programs automatically run at a > > > certain nice level? > > > > I havent tried this but maybe you could nice the shell the user is > > dropped into at login time by changing his passwd file. ie set his shell > > to /usr/bin/nice -5 /usr/bin/sh > > Hm. Change his/her shell to an executable script, which contains this line. > In your way, you get: "/usr/bin/nice -5 /usr/bin/sh": no shell - or > something like this > But: > what about this one: > in /etc/profile (or in /etc/csh.login) make a big case (switch) statement, > eg: > case "$LOGNAME" in # maybe use "$USER" > user1withLowPrio|user2withLowPrio|...) # the users, who need lower priority > renice -p $$ > ;; > *) # anybody else > : nothing, only for convenience > ;; > esac > > That's it. > > Gabor > > -- > #!/bin/ksh > Z='21N16I25C25E30, 40M30E33E25T15U!' ;IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ ';set $Z;for i { [[ $i = ? ]]&&print $i&&break;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i;print -n ${i#???};[[ "$j" = ??? ]]&&print -n "${j#??} "&&j=;typeset +i i;};IFS=' 0123456789 ';set $Z;X=;for i { [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;X="$X $i";typeset +l i;};print "$X" >