260 CHAPTER 16 TAKING CONTROL OF (Disney web site) THE

260 CHAPTER 16 TAKING CONTROL OF THE SYSTEM It s possible to alter the ordering of the process list according to other criteria. For example, you can list the processes by the quantity of memory they re using, by typing M while top is up and running. You can switch back to CPU ordering by typing P. RENICING A PROCESS You can set how much CPU time a process receives while it s actually running. This is done by renicing the process. This isn t something you should do on a regular basis, but it can prove very handy if you start a program that then uses a lot of system resources and makes the system unbearably slow. The first thing to do is to use top to spot the process that needs to be restrained and find out its PID number. This will be listed on the left of the program s entry on the list. Once you know this, type r, and then type in the PID number. You ll then be asked to specify a renice value. The scale goes from 20, which is considered the highest priority, to 19, which is considered the lowest. Therefore, you should type 19. After this, you should find some responsiveness has returned to the system, although how much (if any) depends on the nature of the programs you re running. You might be tempted to bump up the priority of a process to make it run faster, but this may not work because of complexities in the Linux kernel. In fact, it might cause serious problems. Therefore, you should renice with care and only when you must. Controlling Processes Despite the fact that processes running on your computer are usually hidden away, Linux offers complete, unrestricted, and unapologetic control over them. You can terminate processes, change their properties, and learn every item of information there is to know about them. This provides ample scope for damaging the currently running system but, in spite of this, even standard users have complete control over processes that they personally started (one exception is zombie processes, described a bit later in this section). As you might expect, the root user (or any user who adopts superuser powers) has control over all processes that were created by ordinary users, as well as those processes started by the system itself. The user is given this degree of control over processes in order to enact repairs when something goes wrong, such as when a program crashes and won t terminate cleanly. It s impossible for standard users to damage the currently running system by undertaking such work, although they can cause themselves a number of problems. Note This control over processes is what makes Linux so reliable. Because any user can delve into the workings of the kernel and terminate individual processes, crashed programs can be cleaned up with negligible impact on the rest of the system. Killing Processes Whenever you quit a program or, in some cases, when it completes the task you ve asked of it, it will terminate itself. This means ending its own process and also that of any other processes

Leave a Reply