怎样重启Gunicorn

来源:互联网 发布:广西广电网络营业厅 编辑:程序博客网 时间:2024/04/27 18:33

1. 寻找masterpid

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

pstree -ap|grep gunicorn

得到如下的结果。

|-grep,6194 --col gunicorn  |   `-gunicorn,30080 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,4413 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,8030 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,8135 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,8137 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,11532 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,13460 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,19728 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,23585 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,23825 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,27921 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,28899 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,28900 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,28901 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,35637 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,36963 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,43074 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,43118 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,43232 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,43307 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,43308 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,44018 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,46996 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       |-gunicorn,47000 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py  |       `-gunicorn,47650 /usr/local/bin/gunicorn collect:app -c collect_gunicorn.py

很显然,30080就是Gunicorn的主进程。

2. 重启Gunicorn任务

按照官方的推荐方法,很容易执行命令:

#   不需要sudokill -HUP 30080

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

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 发际线低额头窄怎么办 档案写错了涂改怎么办 当时档案写错了怎么办 档案内容写错了怎么办 高中档案写错了怎么办 上大学档案丢了怎么办 u盘总提示格式化怎么办 黑莓手机id锁了怎么办 美图手机进水了怎么办 球兰叶子发黄软怎么办 蟹爪莲叶子发红怎么办 保险箱没电了打不开怎么办 宁波臭冬瓜酸的怎么办 甜酒酿做了酸了怎么办 孕妇喝了醪糟汤怎么办 鱼侧翻但又没死怎么办 原汁机盖子卡死怎么办 惠人原汁机坏了怎么办 泡芙鸡蛋加多了怎么办 淡奶油打过了怎么办 淡奶油打发过了怎么办 雷神锤子被捏碎怎么办 私处毛很多很黑怎么办 脸上长黑色的毛怎么办 十字军之王2毁容怎么办 多囊卵巢综合症想怀孕怎么办 12306账户名忘了怎么办 丧尸病毒爆发了怎么办 看了鬼故事害怕怎么办 微信验证码忘了怎么办 微拉美后脸变形怎么办 感情不好心好累怎么办 刚买乌龟不吃食怎么办 新小乌龟不吃食怎么办 吃太多了好难受怎么办 已经吃了苦丝瓜怎么办 墨兰叶子尖发黄怎么办 气膜建筑停电了怎么办 脖子转一下就痛怎么办 手抄报空的地方怎么办 20多岁白发很多怎么办