1

I am running one binary with highest priority like

nice -n -20 binary

Now I want to run same binary such that it runs with high priority without nice -n 20 binary like

 ./binary // runs with high priority same as nice -n -20 binary with any setting

Are there any configurations which says kernel to start process with higher priority when I start binary with ./binary,I don't wont to start binary with nice -n -20 binary every time

So how to do it give your suggestion

Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38

3 Answers3

3

you can create alias for it

alias binary='nice -n -20 binary'

after that if you execute binary then it will start with higher priority

Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38
2

Create a script that contains your nice command, and run that instead.

e.g.

echo  nice -n -20 binary > binary2
chmod +x binary2

And then to run it, just do this:

./binary2
GregHNZ
  • 7,946
  • 1
  • 28
  • 30
0

I believe you want something like this,

sudo nice -n -20 ./binary

From info coreutils 'nice invocation'

Only a privileged user may run a process with lower niceness:

Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249