Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does linux end the process

Shulou Source: shulou.com Published: 2022-06-01 18:32:55 09月24日 Update

This article introduces the knowledge of "how to end the process of linux". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First use the ps-ef command to determine the PID of the process to kill, and then enter the following command:

# kill-pid

Note: standard kill commands usually achieve their goals. Terminate the problematic process and release the resources of the process to the system. However, if the process starts the child process, only the parent process is killed, and the child process is still running, thus still consuming resources. To prevent these so-called "zombie processes", be sure to kill all of the parent's child processes before killing them.

* determine the PID or PPID of the process to be killed

# ps-ef | grep httpd

End the process

# kill-l PID

The-l option tells the kill command to end the process as if the user who started the process had logged out. When using this option, the kill command also attempts to kill the remaining child processes. But this command doesn't always work-maybe you still need to kill the child process by hand, and then kill the parent process.

Send a TERM signal to the parent process in an attempt to kill it and its children.

# kill-TERM PPID

* killall command

The killall command kills all processes in the same process group. It allows you to specify the name of the process to be terminated instead of PID.

# killall httpd

* stop and restart the process

Sometimes you just want to simply stop and restart the process. As follows:

# kill-HUP PID

This command causes the Linux gentle execution process to shut down and then restart immediately. This command is convenient when configuring the application and can be executed when the process needs to be restarted after changes to the configuration file.

That's all for "how linux ends the process". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Process command content more knowledge resource configuration utility success learning next signal zombie name dilemma reality application always can situation manual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Information Shulou Tech Info Redmi Linux