Click to See Complete Forum and Search --> : nice: cannot set niceness: Permission denied
zeroth
07-07-2006, 12:16 AM
user@helix/drive_g/Valve/Steam# cd /drive_g/Valve/Steam && WINEDEBUG=-all nice -n -20 wine steam.exe
nice: cannot set niceness: Permission denied
tried setting a sticky bit for nice and changing its group to "user" .... still permission denied.
how do I do this without being root?
cybertron
07-07-2006, 09:46 AM
You want nice -n 19, not -20. -20 is the highest priority you can give a process, which is why you have to be root to do it.
zeroth
07-07-2006, 09:47 AM
You want nice -n 19, not -20. -20 is the highest priority you can give a process, which is why you have to be root to do it.
I recall trying to set it to -19 and getting the same thing ...
cybertron
07-07-2006, 09:54 AM
Heh, get rid of all of those -'s and you'll be okay. The only one should be in front of -n.
Try this:
user@helix/drive_g/Valve/Steam# cd /drive_g/Valve/Steam && WINEDEBUG=-all nice -n 19 wine steam.exe
BTW, you really have # at the end of your regular user prompt? Typically that's used to denote that you are logged in as root.
zeroth
07-07-2006, 11:14 AM
Heh, get rid of all of those -'s and you'll be okay. The only one should be in front of -n.
Try this:
user@helix/drive_g/Valve/Steam# cd /drive_g/Valve/Steam && WINEDEBUG=-all nice -n 19 wine steam.exe
but I thought the value ranged from -20 to 20 ?
/me man's the nice
edit:
/me confirms
it ranges from -20 to 19.
BTW, you really have # at the end of your regular user prompt? Typically that's used to denote that you are logged in as root.
Yes I do. I figured there was some meaning behind the $ vs # things. edit: running gentoo. I don't think I'm running a custom .bash_profile on this system .... though its possible.
je_fro
07-07-2006, 12:34 PM
Yeah, if you have a # at the end of your prompt, you're running as root....not very smart. That's a good way to hose your system.
zeroth
07-07-2006, 12:51 PM
Yeah, if you have a # at the end of your prompt, you're running as root....not very smart. That's a good way to hose your system.
notice that I wasn't running as root. For some reason, the PS1 envvar was modified to do that. not sure why, but I wasn't root.
p.s.
never hosed a system.
edit: except for one time I unmerged gcc on Gentoo...but I easily put it right back with binary packages :-D
cybertron
07-07-2006, 01:13 PM
Yeah, I figured you weren't actually running as root since it wouldn't let you renice to -20. It's strange that Gentoo would have set that up for you. I wonder if at some point you customized your prompt and put PS1 where you meant PS2 or something.
For the renicing, just remember that negative numbers are higher priority (the process isn't as nice to the other processes:)), whereas positive numbers mean that it is more likely to give up the CPU. The reason you want to set Wine to be very nice is that one of the processes it starts likes to eat CPU sometimes and renicing it forces it to stop doing that.
zeroth
07-07-2006, 01:15 PM
I want the wine process to be the meanest mofo there is. err...
I just want the game to run as best as it can, using maximal CPU power.
cybertron
07-07-2006, 01:22 PM
Yeah, it's kind of backwards but that's what this will do. For whatever reason nicing Wine when you start it gets the bad process out of the way and lets the actual Steam process (in this case) use the CPU as much as possible. I would have expected them to both get niced the same and end up sharing the CPU anyway, but in my experience that's not what happens. If it does you can always renice wineserver (the problem process) after it starts, but I don't remember the command to do that right off hand.
hlrguy
07-07-2006, 01:42 PM
Start it normally
su - root
<enter password>
renice -19 <PID>
With nice and renice, you need root (maybe a user can be given permission to set negative nice?, never investigated) to set to a higher priority than 0 (i.e. negative).
I renice artsd to -19 and I have yet to be able to beat on my computer hard enough to ever cause a playback skip. :) I avoid -20 because I believe that if the OS really had to pre-empt music for a very critical -20 process, well, I'll deal with a playback skip if it ever happens.
hlrguy