Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* User Priorities
@ 1996-04-18  4:00 Jean Fitzmaurice
  0 siblings, 0 replies; only message in thread
From: Jean Fitzmaurice @ 1996-04-18  4:00 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-04-18  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-04-18  4:00 User Priorities Jean Fitzmaurice

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox