Article Title: processes that cannot end in linux can end in this way. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
First, use the ps-ef command to determine the PID of the process to be killed, and then enter the following command:
# Kill-pid
Note: Standard kill commands can achieve the goal. Terminate the problematic process and release the process resources to the system. However, if a child process is started and only the parent process is killed, the child process is still running and consumes resources. To prevent these so-called "zombie processes", ensure that all child processes are killed before the parent process is killed.
* Determine the PID or PPID of the process to be killed
# Ps-ef | grep httpd
End 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 this option is used, the kill command also tries to kill the left child process. But this command is not always successful-you may still need to manually kill the child process and then kill the parent process.
Send a TERM signal to the parent process, trying to kill it and its child process.
# Kill-TERM PPID
* Killall command
Killall command to kill all processes in the same process group. It allows you to specify the name of the process to be terminated, rather than the PID.
# Killall httpd
* Stop and restart Processes
Sometimes you only want to simply stop and restart the process. As follows:
# Kill-HUP PID
This command causes Linux to shut down the slow execution process and then restart immediately. This command is convenient when you configure the application. You can execute this command when you need to restart the process after modifying the configuration file.