CHAPTER 16 TAKING CONTROL (Web hosting unlimited bandwidth) OF THE SYSTEM

CHAPTER 16 TAKING CONTROL OF THE SYSTEM Note No magic is involved in killing processes. All that happens is that top sends them a terminate signal. In other words, it contacts them and asks them to terminate. By default, all processes are designed to listen for commands such as this; it s part and parcel of how programs work under Linux. When a program is described as crashed, it means that the user is unable to use the program itself to issue the terminate command (such as Quit). A crashed program might not be taking input, but its processes will probably still be running. In many cases, zombie processes simply won t go away. When this happens, you have two options. The first is to restart the program that is likely to be the zombie s owner, in the hope that it will reattach with the zombie, and then quit the program. With any luck, it will take the zombie child with it this time. Alternatively, you can simply reboot your PC. But it s important to note that zombie processes are harmless and can be left in peace on your system! Using Other Commands to Control Processes You don t always need to use top to control processes. A range of quick and cheerful shell commands can diagnose and treat process problems. The first of these is the ps command. This stands for Process Status and will report a list of currently running processes on your system. This command is normally used with the -aux options: ps aux This will return a list something like what you see when you run top. If you can spot the problematic process, look for its PID and issue the following command: kill For example, to kill a process with a PID of 5122, you would type this: kill 5122 If, after this, you find the process isn t killed, then you should use the top program, as described in the previous sections, because it allows for a more in-depth investigation. Another handy process-killing command lets you use the actual process name. The killall command is handy if you already know from past experience what a program s process is called. For example, to kill the process called firefox-bin, which is the chief process of the Firefox web browser, you would use the following command: killall firefox-bin Caution Make sure you re as specific as possible when using the killall command. Issuing a command like killallbin will kill all processes that might have the word bin in them!

Leave a Reply