Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-19-2004, 08:33 AM
|
#1
|
|
Member
Registered: Oct 2003
Location: Grand Forks, ND
Distribution: Suse/Slackware/RH
Posts: 161
Rep:
|
nice and renice (question)
I have been able to use 'nice' and 'renice' to set priorities of processes but I run into a few weird problems with 'renice'. When I start an application without 'nice' I get the default priority of 0 and when I manually set the priority using 'nice' it works fine. BUT when a process is already running (with either the default priority or the newly set one) I can't only renice to the current priority and lower. I get a permission denied if I try to go higher. I think this example will make it clear:
prompt> ./myscript1 &
prompt> nice 10 ./myscript2 &
Now if I want to change the first scripts priority to a lower one (like the second one) I can successfully do this: (for the sake of the example lets say the priority of myscript1 is 24106)
prompt> renice 10 24106
24106: old priority 0, new priority 10
And that works fine, so both are running at the lower priority of 10.
Now if I want to put them back to 0 or anything higher than 10 it always says permission denied:
prompt>renice 5 24106
renice: 24106: setpriority: Permission denied
But I can successfully set them to (the same or) lower priorities:
prompt>renice 10 24106
24106: old priority 10, new priority 10
prompt>renice 11 24106
24106: old priority 10, new priority 11
prompt>renice 10 24106
renice: 24106: setpriority: Permission denied
But then I am just getting stuck at lower priorities since now that I have dropped to 11 in the above example I can't get back up higher...
|
|
|
|
10-19-2004, 09:06 AM
|
#2
|
|
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Rep:
|
I did a quick play at the command line myself, and it would appear that regular users cannot 'unnice' their own processes. I knew that reg users couldn't negative nice anything, but it seems odd that they cannot bring the priority back to the default of '0'.
Try as root and you can set them lower (higher?) again...
|
|
|
|
10-19-2004, 09:33 AM
|
#3
|
|
Member
Registered: Oct 2003
Location: Grand Forks, ND
Distribution: Suse/Slackware/RH
Posts: 161
Original Poster
Rep:
|
Well I can use root to do anything on my own systems, but if I had root access on the system in question I wouldn't worry about nice'ing anything as I wouldn't be nice. But it isn't my system so I don't have root... I too just thought it was odd that I coulded renice my processes (as long as I stayed over 0). There must be a reson for that though...
|
|
|
|
10-19-2004, 09:37 AM
|
#4
|
|
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Rep:
|
I read both the man and info page for nice and renice and saw no mention of this behavior.
|
|
|
|
10-19-2004, 09:49 AM
|
#5
|
|
Member
Registered: Oct 2003
Location: Grand Forks, ND
Distribution: Suse/Slackware/RH
Posts: 161
Original Poster
Rep:
|
That is what prompted my question, I too read them and then was puzzled why I kept having the aforementioned problem. (so I guess the question still stands)
|
|
|
|
10-19-2004, 11:58 AM
|
#6
|
|
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Rep:
|
Sorry man, I'm as flabbergasted as you
nice/renice are part of coreutils, which is distributed by the FSF, maybe that is your next place to look if you really want to get to the bottom of this.
|
|
|
|
10-19-2004, 12:00 PM
|
#7
|
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,756
|
This is from a UNIX man page on renice....
Quote:
Altering Process Priority
Users other than the privileged user may only alter the
priority of processes they own, and can only monotonically
increase their "nice value" within the range 0 to 19. This
prevents overriding administrative fiats.
|
So once you've lowered the priority of a process, your screwed. Of course I'm assuming that nobody has re-written renice for Linux and we're all just using the UNIX version
Last edited by Hangdog42; 10-19-2004 at 12:02 PM.
|
|
|
|
10-19-2004, 12:10 PM
|
#8
|
|
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Rep:
|
Good call. I read that paragraph paying close attention to "Users other than the privileged user may only alter the priority of processes they own" and selectively ignoring "and can only monotonically increase their "nice value""
<shrug>
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:11 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|