From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,692facf81bfeb2fa,start X-Google-Attributes: gidfee84,public From: jfitz@athena.mit.edu (Jean Fitzmaurice) Subject: User Priorities Date: 1996/04/18 Message-ID: <4l6g97$l0m@senator-bedfellow.MIT.EDU>#1/1 X-Deja-AN: 148281801 distribution: world organization: Massachusetts Institute of Technology newsgroups: comp.unix.osf.osf1 OSF/1 3.0, currently our Alpha 3000-400 has a reschedule file which runs: it renices the user process after 5 minutes CPU, some users have lower priority and the default is 19 the question is that it would be better if this were more flexible. I want a user who has '5' priority be able to run a process under '1' priority but only when they activate it, and only for a process which takes less than one hour. the mix of processes on this workstation is one user running a process for days, and another user runs processes which take 30 minutes. If you have a suggestion, please reply to me email. thanks, -Jean jfitz@mit.edu --------------------------------------------------- #!/bin/csh date set noglob set topline = `/sbin/ps auxww | /usr/bin/head -2 | /usr/bin/tail +2` set user = `echo $topline | /usr/bin/awk '{print $1}'` set pid = `echo $topline | /usr/bin/awk '{print $2}'` set cpumins = `echo $topline | /usr/bin/awk '{print $10}' | /usr/bin/cut -f1 -d:` echo $topline echo $user, $pid, $cpumins #exceptions - root is owner, tine is less than five mins if ( $user == 'root' ) then exit 1 endif if ( $cpumins < 5 ) then exit 2 endif # now the exceptions to the blanket -19 if ( $user == 'somevip' ) then set prio = 1 goto setit endif if ( $user == 'bigcheese' ) then set prio = 1 goto setit endif if ( $user == 'staff' ) then set prio = 5 goto setit endif goto setit endif #declare blanket and renice accordingly set prio = 19 setit: echo i will renice pid $pid to $prio /usr/sbin/renice $prio $pid exit