linux 优雅的退出/关闭/重启gunicorn进程

在工作中,会发现gunicorn启动的web服务,无论怎么使用kill -9 进程号都是无法杀死gunicorn,经过我一番百度和谷歌,发现想要删除gunicorn进程其实很简单。

第一步获取Gunicorn进程树:

通过执行如下命令,可以获取Gunicorn进程树:

pstree -ap|grep gunicorn

得到的结果如下:

重启Gunicorn任务

kill -HUP 85898

3. 退出Gunicorn任务

kill -9 74430

执行上述命令后,再次执行“pstree -ap|grep gunicorn”,我们很容易发现,除了主进程,其他的Gunicorn进程都已经销毁,并新建了进程(进程ID发生了变化)。



本文地址:http://www.chenxm.cc/post/573.html
posted @ 2018-04-23 17:21  lowenve  阅读(1878)  评论(0)    收藏  举报