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 know that non-root users can renice a process up, but not renice a process priority down.

$ nice yes >/dev/null & p=$!
$ renice 15 -p $p 
8414: old priority 10, new priority 15
$ renice 12 -p $p
renice: 8414: setpriority: Permission denied
$ kill $p

I understand that as a non-root user I should not have the ability to (re)nice a process into negative nice territory, or that root may have started a process on my behalf at a higher nice level.

The question is for what logical reason can a non-root user not renice their own processed downward, even if just no further down to the original priority in which it was instatiated?

share|improve this question

3 Answers 3

If root users are able to reprioritize another user's process because it's using too much resources, a user should not be able to circumvent that and change it back.

share|improve this answer
    
Should we not consider nice values [-20,-1] to be system priorities vs. the user 'space' [0,19] I get what you're saying but I'm of the recent persuasion that user processes should be able to re-prioritize themselves or their children...at least from a base priority set by root? –  Xepoch Dec 28 '09 at 17:07
    
Yes but the root user may realize the base priority was too high and reprioritize all of a certain users processes ( renice -u user... ). I've seen my school's sysadmin do something similar to our processes when he was running batch jobs so it would finish faster. –  John T Dec 28 '09 at 17:38

Because then programs would have an incentive to prioritize themselves at the expense of the entire system.

share|improve this answer
    
Not necessarily. For instance, user renice could not drop below 0. –  Xepoch Dec 28 '09 at 17:02
    
...which would still give the process a higher priority than all those other processes running at 20. –  njd Feb 9 '10 at 12:57

renice modifies program niceness - higher number means lower priority.

I guess the reason is that the starting niceness isn't probably not remembered - only the current niceness value. So there's no good way of determining if a user can renice a program to higher priority. (This is a guess... Maybe someone can verify it? )

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.