Managing System Processes


As you learned in Chapter 28, "Command-Line System Administration," in any running system, it is important to be able to list the running processes, to change the priority at which they execute relative to other processes, and to kill those processes that need to be ended for some reason or other.

At the desktop, all these tasks are accomplished with the System Monitor tool. Open the System Monitor by choosing Applications, System Tools, System Monitor. The System Monitor window appears, open to the Process Listing tab, as shown in Figure 29.1.

Figure 29.1. The System Monitor tool (maximized here) displays a list of running processes.


You can use the options in the Process Listing tab to list the processes that are running on your system, change the priority (amount of CPU time) given to running processes, and kill processes you decide should no longer run.

The list of displayed processes is updated on a continuous basis as system conditions evolve and the list of currently running processes changes.

You can change the view options to limit the display to certain types of running programs. That action trims the length of the displayed list and limits the display to only those files you're interested in viewing. To change the view, open the Show drop-down list to the right of the Search box and choose any of these options:

  • The All Processes option displays all the processes running on the system, regardless of owner or whether the process is currently active (calculating or executing rather than waiting for data or input).

  • The My Processes option displays all the processes owned by the user who started the System Monitor tool.

  • The Active Processes option displays all processes that are currently active.

Adjusting Process Priority

The Process Listing tab in the System Monitor can be used to adjust the priority of any running process upward (less CPU time) or downward (more CPU time). By adjusting the priority, you ensure that critical processes get as much CPU time as possible on an overloaded system, sometimes at the expense of other processes. For example, suppose that you are running a large spreadsheet computation involving many thousands of cells on a Linux computer that is also your small company's web server. Because you want to ensure that customers can access your website as quickly as possible while the spreadsheet computes for several hours, you could adjust the priority of your spreadsheet application upward (less CPU time) so that it uses processing resources only when other taskslike the web serverdon't need them.

To adjust the priority of a running process, select its entry in the Process Name list and then choose Edit, Change Priority. The Change Priority dialog box appears, as shown in Figure 29.2.

Figure 29.2. Here, the priority for sendmail is being changed. To increase the priority of the selected process, drag the slider to the left. Drag the slider to the right to decrease the process's priority.


In the Change Priority dialog box, adjust the slider downward toward negative numbers to raise the priority of the process (giving it more CPU time) or toward positive numbers to lower the priority of the process (giving it less CPU time). All user processes have a default priority (also sometimes known as a nice value) of 0. After you adjust the priority of the process relative to other running processes, click the Change Priority button to assign the priority and close the dialog box.

Killing Running Processes

If a running process becomes unresponsive or if you need to stop the process for administrative reasons, you can use the System Monitor tool to end or kill the process. When you end a process, Linux asks the process to exit. Occasionally, a process refuses to do sosometimes because it is still busy storing information or working, sometimes because it has become unstable. When this situation occurs, you might decide that you want to kill the process, interrupting anything it might be doing and causing it to exit immediately. When you kill a process, any unsaved files opened by the process are lost, and the process does not have a chance to close open network connections gracefully and perform other similar housekeeping tasks before exiting. Thus, it is usually a good idea to try to end a process first, killing it afterward only if absolutely necessary.

To end a process, select it in the Process Name list of the Process Listing tab and click the End Process button at the lower-right corner of the tab. The End Process confirmation dialog box appears.

To confirm that you want to end the process, click the End Process button. The System Monitor tool sends a signal to the process indicating that it is time to quit.

If you find that you can't cause the process to quit using the End Process button, you can force the process to be killed. Select the offending process from the Process Name list and then choose Edit, Kill Process; the Kill Process confirmation dialog box appears. Click the Kill Process button to kill the process.

Careless Killing Can Lead to Lost Data

You should use the Kill Process option only after you try to kill a process using the End Process button. Forcefully killing a process takes it out of the process table without giving it a chance to close open files or connections.


To confirm that you want to kill the process unconditionally, click the Kill Process button. The process is terminated forcefully and removed from the list of running processes.

Killing an Application Doesn't Kill for Good

Ending or killing a running process does not affect your ability to run the same program in the future, nor does it affect other instances of the same application that are also running.




    SAMS Teach Yourself Red Hat(r) Fedora(tm) 4 Linux(r) All in One
    Cisco ASA and PIX Firewall Handbook
    ISBN: N/A
    EAN: 2147483647
    Year: 2006
    Pages: 311
    Authors: David Hucaby

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net