LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2009, 03:42 PM   #1
extendedping
Member
 
Registered: Feb 2004
Posts: 210

Rep: Reputation: 30
I don't understand the "NICE" command


I am trying to run a command (to open a Konsole session telnetted to multiple devices) at a higher priority. what is happening is every time I run the command the Konsole opens but only opens a few (there are 9 total that I need) of the sessions and gives a message "interrupted system call". well I don't know quite how to fix this or what the error means but I figured I would try to run the /usr/bin/konsole (in fedora 10) at a higher priority. well my book says that a lower nice value means a higher priority for the process. so in other words if I am getting it, the command "nice -n -10 /bin/Konsole" should run konsole at a higher priority which is what I want to try. perhaps it is doing that I don't know but when I then run ps axl and look at the 5th and 6th columns (PRI and NI) I see the following

[root@feddy10 ~]# ps axl | grep konsole
5 0 5183 1 10 -10 439440 29012 sys_po S<l ? 0:00 /usr/bin/konsole --new-tab -p tabtitle=VL3_1 -e telnet localhost 2020

you can see my pri value is now 10 and my ni is -10. however when I don't run the command starting with nice -n -10 the columns read 20 (pri) and 0 (ni). so shouldn't nice -n -10 command, make the pri value go above 20 (higher) not down to 10 (lower).

so what is actually happening here? I have read on the internet and in my book that starting a command with a nice -n -x (negative value up to -20) should raise the priority of the process and that I should see the priority (pri in the ps command output) up and not down.

help me out please. oh and the command being run is from within gns3 a cisco emulator so I am trying to open multiple telnet session in tabs using /bin/konsole. the complete command run from within the gns3 app is...

nice -n -10 /usr/bin/konsole --new-tab -p tabtitle=%d -e telnet %h %p >/dev/null 2>&1 &

got the command from the gns3 linux documentation, the exact command they give is the above minus the "nice -n -10" which is what I am putting in.

thank you much in advance, it would be great to

1) solve the "interrupted system call" message that pops up when I run the command (which again only opens a few of the connections not all thus defeating the overall command purpose) and


2) regardless of if I can fix the above issue, get a clear answer as to what effect "nice -n +-x command"
should have on that commands priority and how that will be displayed by the ps command.

I know that's a lot but I wanted to provide as much info as I could again thanks much in advance.
 
Old 02-01-2009, 03:48 PM   #2
extendedping
Member
 
Registered: Feb 2004
Posts: 210

Original Poster
Rep: Reputation: 30
oh also in my fedora 10 I am running the gnome desktop but I know the Konsole is a kd3 app..I don't know if that would be messing things up a bit as well, just thought I'd ask. I would love to simply use the gnome-terminal to open multiple tabs but I am not that advanced would need someone to show me the appropriate commands
 
Old 02-01-2009, 07:50 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,168
Blog Entries: 4

Rep: Reputation: 3707Reputation: 3707Reputation: 3707Reputation: 3707Reputation: 3707Reputation: 3707Reputation: 3707Reputation: 3707Reputation: 3707Reputation: 3707Reputation: 3707
Generally, you should never try to run things at a "higher" priority. Instead, "be nice" whenever you can.

The scheduler will endeavor to keep the CPU always as busy as possible. If there's work to be done it will do it. Process priorities come into play when "something's gotta give."

The "nice" command volunteers to run a command at an inferior dispatching priority ... "go ahead, I'll be nice, you can play through if you need to." That's it.

Strange as it may seem: instead of trying to tell the scheduler "what's urgent," help it to identify "what's really not."
 
Old 02-02-2009, 01:20 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,169

Rep: Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680
Incidentally
Quote:
Only the superuser may specify a negative increment, or priority increase.
from the man page:

man 2 nice
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command "mail" returns "panic: temporary file seek" kenneho Linux - Software 5 12-23-2008 03:27 AM
Feeding the output of "diff" or "cat" command to dpkg --purge kushalkoolwal Debian 9 06-19-2008 07:27 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
Where to find a "nice" Howto" for modem setup and use for IPS usage xerxesii Linux - Hardware 2 03-27-2007 12:21 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration