Killing the zombies that reside on your Linux….

zombie

The processes are running programs. Each software can start one or more processes that will have to be loaded into main memory for processing by the CPU. Sometimes a process can be subdivided into so-called LWPs or lightweight processes, that is, into threads, threads or threads, whatever you want to call them. When all the threads of a process have been executed, then the process is finished.

Made that introduction, say that processes in Unix environments are identified by an ID and can have various states. That ID or identifier is a number assigned to said process to be able to track it. You can easily know the PID of a process with the ps tool, htop, among other tools. And you can also see information about its status.

The States in which a process can be in Linux are:

  • Running: the process is running.
  • Sleeping: the process is sleeping, waiting for an event to happen that wakes it up and continues its execution.
  • Terminating: the process is terminated or dead.
  • Device I / O - I / O device processes that cannot be interrupted.
  • Zombie: when a child process terminates before its parent process, the child information is kept until the parent terminates as well. The son is really dead or finished, but cannot be destroyed to free up resources. It doesn't really take up CPU time, but it does take up space in the process table.

One way of sending signals to the processes so that they go to one state or another is through the kill command. If you use the kill -l command you will see the list of signals that you can send. The most typical is to send a KILL signal to a process to kill it. For example:

kill -l

kill -9 <PID>

Signal 9 or SIGKILL directly kills the process signaled by PID without checking the status. Instead, SIGTERM will terminate the process only in certain circumstances, since it does check the status of the process to which the signal is sent and if it is not safe, the signal will be ignored.

Well, having said all that, tools like ps have a column that shows the STAT or status of the process. If you look at that column, the initial of the state it is in appears. For example, S for sleeping, or Z for zombie, etc. You may check if you have zombie processes or not on your system with the following command:

ps aux | grep 'Z'

In my case, there was one with PID 6393. And for kill zombie processes, you can use the following command:

kill 6393


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

A comment, leave yours

Leave a Comment

Your email address will not be published.

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   John Rubio said

    Hello I do this process for a process but I give KILL and I go back to review and follow this process