How to set a permanent process priority?

Eduardo Robles Elvira edulix at gmail.com
Thu Sep 13 00:55:42 BST 2007


El Jueves, 13 de Septiembre de 2007, D. Michael McIntyre escribió:
> On Wednesday 12 September 2007, Ali Milis wrote:
> > But is there a way to set a permanent priority?
>
> I can't find one.  A common suggestion among the articles I found is to
> wrap it in a script.
>
> To avoid problems with upgrades, you could put the script in
> /usr/local/bin, and ensure your PATH puts /usr/local first, which I think
> is pretty typical out of the box.
>
> For example, /usr/bin/audacity becomes
>
> #!/bin/bash
> /usr/bin/audacity
> renice -5 $(pidof audacity)
>
> Or something like that.  Running "audacity" would find the script
> in /usr/local/bin first.  This wouldn't work if launching from an icon or
> menu entry that's pointing directly at /usr/bin/audacity.  You'd have to
> change this.
> --
> D. Michael McIntyre

Solution: move audacity binary to /usr/bin/audacity2, then put the script 
in /usr/bin/audacity. Sometimes I've used this technique for example to see 
with which arguments is a program calling ifconfig or whatever command. (You 
could also debug it anyway). It works fine, although it's a bit hackish to be 
honest. Isn't this kind of thing what dtrace brings to the table in 
OpenSolaris?
 
-- 
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man." (George Bernard Shaw)



More information about the kubuntu-users mailing list