The*_*One 2 process kill nohup
因此,为了让我的简单博客永久运行,我使用了以下nohup
命令:
nohup python manage.py runserver 0.0.0.0:8000
Run Code Online (Sandbox Code Playgroud)
一切正常,即使我退出终端,我的博客仍在运行。但是现在我不想再运行它了,所以我试图杀死它,但出现错误:
# ps aux | grep nohup
root 23427 0.0 0.0 103308 860 pts/1 S+ 11:56 0:00 grep nohup
# kill -9 23427
bash: kill: (23427) - No such process
Run Code Online (Sandbox Code Playgroud)
当然,我的博客还在继续运行,所以我不明白刚刚发生了什么。有没有办法处理这个问题?
Dop*_*oti 11
你没有nohup
流程。您的搜索找到了一个grep
正在搜索的实例nohup
,但是当您收到下一个提示时,该grep
过程已经终止。你实际上是在寻找一个python
实例。
ps aux | grep python | grep manage.py # This will show you the process you're looking for
kill $(ps aux | grep python | grep manage.py | awk '{print $2}') # This will kill it.
Run Code Online (Sandbox Code Playgroud)