12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

System Configuration—System ManagementThere might be more than one process running with the same name. For example,multiple getty processes or multiple httpd processes. Using killall will send thespecified signal to all these processes, which may not be what you had intended to do.The pkill(1) is another variant of the kill family that kills or sends signals to one ormore processes that match the pattern given on the following command line:# pkill -KILL tcshUse pkill(1) with even more care as you kill the processes that youdon't actually intend to kill.Prioritizing Running Processes—nice and reniceRunning processes may have different scheduler priorities and consequently havemore CPU time assigned. The priority-level is called nice. You can see the nice-levelof the current process using the ps(1) or top(1) commands as follows:# ps -lUID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND1001 61737 61736 0 20 0 4172 2500 pause Is p0 0:00.03 -tcsh (tcsh1001 98391 98390 0 20 0 4176 2604 pause Ss p1 0:00.03 -tcsh (tcsh1001 98479 98391 0 96 0 3256 804 - R+ p1 0:00.00 ps -lThe default nice-level for programs that you run is set to zero. The nice(1) utilitywill let you run a program with altered scheduling priority.# nice –n 5 gzip fileIn the above example, the command gzip file is called using nice with the defaultnice value incremented by 5. This means that if the current shell is running withnice value 0 (which is the default), the nice value for the called utility will be 5.If you are running csh or tcsh, calling nice will actually invoke shell'sbuilt-in nice function. In order to run the actual nice utility, you shouldcall it using the actual path: /usr/bin/niceIn order to change the nice value for an already running process, you may use therenice(8) utility. The renice(8) utility lets you to change the nice value of aprocess by its PID or a group of processes that are owned by a specific user:# renice –n 5 335[ 68 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!