1. 程式人生 > >linux 優雅的退出/關閉/重啟gunicorn進程

linux 優雅的退出/關閉/重啟gunicorn進程

inux HR down ref 通過 AS 銷毀 發生 html

在工作中,會發現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

linux 優雅的退出/關閉/重啟gunicorn進程