Processes that cannot end in linux can end in this way

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.