Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to set up steam to run automatically with a higher than default priority, which involves starting it with nice. But to set a priority lower than 0, I must be root. Problem is that steam doesn't like to be started as root, so if I do something like sudo nice -n -1 steam it says that it cannot be started as root. Furthermore, if I use sudo -u myusername nice -n -1 steam, nice complains that it hasn't got the privileges to set that priority.

I used visudo to give myuser the privilege to run sudo nice without password, but it was futile.

I know this HAS to have been answered somewhere else, but I don't know how to search.. it's a rather specific problem.

Thanks in advance

EDIT: using renice AFTER I started steam won't do, because the child processes (games) won't inherit the nice value from the parent that way

share|improve this question
    
Can;t you just start it as a user and then renice is as root ? –  Hennes Apr 15 '13 at 23:25
    
if I use renice then the children processes won't gain the same nice value :( –  Pablo Mescher Apr 15 '13 at 23:32

2 Answers 2

People on the steam forum have suggested to start screen, renice that, and then run steam under its control. Does that work for you?

share|improve this answer
    
I don't understand how this answers my question. I'm not having problems running steam, I want to give it a higher priority so that it uses more of my olddated hardware –  Pablo Mescher Apr 15 '13 at 23:53
1  
Yes. And if you adjust the niceness of the screen session the steam you execute from within it will inherit its niceness. –  tink Apr 16 '13 at 0:40

I believe you just need to rearrange the pieces you already have: become root, and type

nice -n -1 sudo -uyourusernamesteam

[edit]
or

nice -n -1 suyourusername-c steam

The idea being that you

  1. Become privileged,
  2. Set priority higher than the default (numerically lower than 0), which requires privileges,
  3. Use sudo or su to revert to your normal (non-privileged) identity (but, hopefully, retain the priority you set in the previous step), and then
  4. Run the (steam) command, with elevated priority but not elevated privileges.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.