[lug] automatic renice?

D. Stimits stimits at comcast.net
Fri Jun 17 16:12:07 MDT 2005


Zan Lynx wrote:
> On Fri, 2005-06-17 at 16:03 -0600, D. Stimits wrote:
> 
>>I have a program (x2x), that when it runs (regardless of what user runs 
>>it), I'd like it to automatically renice to -1...but this is a root only 
>>command. I don't think there is any automatic way to renice this program 
>>any time it is run, I believe sudo and compound commands are probably 
>>required. But maybe someone here knows, is there a way to tell the 
>>system that no matter who runs x2x, that it should be reniced to -1? Is 
>>there any kind of renice daemon facility?
>>
>>D. Stimits, stimits AT comcast DOT net
> 
> 
> People have written renicer daemons.  It's pretty easy to roll up a
> quick script using renice, pgrep and a while/sleep loop.

This is sort of what I'm looking for...was hoping though that there 
might be something that doesn't poll...something I could run as an rc 
script, and set config with a /etc/sysconfig/ file. I suspect to do so 
would require a kernel module though.

> Or, you could rename x2x to x2x.real and make a shell script called x2x
> that does: exec nice --1 x2x.real

This latter would not work, unless I make some sort of sudo retrofit. 
Renice to negative values (I'm increasing priority of x2x) requires 
root, but non-root will be running it.

D. Stimits, stimits AT comcast DOT net



More information about the LUG mailing list