The solution to kill -9 under Linux to kill the process or kill it and start it automatically

Problem description
When killing the process with kill -9 under ubuntu, it is found that it cannot be killed, or it is killed and then restarted immediately.
The reason is that the parent process of the process is still there , so it will automatically start after killing the process. It seems that we did not kill it.

Solution

ps -aux   #查看所有进程,找到需要kill的PID号。 假设该进程的PID号是18478
cd /proc/18478    #cd /proc/PID号
cat status   #查看该PID号对应的父进程,即找到PPID这个进程号,假设是1000
kill -9 1000    #先杀死父进程
kill -9 18478   #再杀死该进程,即可

Guess you like

Origin blog.csdn.net/weixin_35770067/article/details/131239530