大家看看这个 django+nginx 里配置的 uwsgi.ini 有什么问题吗? 为什么一启动 uwsgi 就无法用 reboot 重启服务器了。一直卡死

2020-02-19 12:46:05 +08:00
 python30
centos7.4 7.6 都一样
现在用的 centos7.6
python3.6
django2.2
只要一启动 uwsgi.ini 就无法在 centos 里用 reboot 重启了

得需要在控制面版里重启才可以。

应该是 uwsgi 配置的不对。

请大家帮我看看。谢稿。

xxx_uwsgi.ini
···
# myweb_uwsgi.ini file
[uwsgi]

#django-related settings
socket = 127.0.0.1:8008
# the base directory (full path)
chdir = /var/wwwroot/html/aabbcc

# Django s wsgi file
module = aabbcc.wsgi:application

env = DJANGO_SETTINGS_MODULE = aabbcc.settings
daemonize = /var/log/nginx/aabbcc_access.log;
# process-related settings
# master
master = true
py-autoreload = 1

# maximum number of worker processes
processes = 4

# ... with appropriate permissions - may be needed
# chmod-socket = 664
# clear environment on exit
vacuum = true
···


/etc/rc.d/rc.local 里面:
···
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
cd /var/wwwroot/html/aabbcc && /usr/local/bin/uwsgi --ini aabbcc_uwsgi.ini
···
2337 次点击
所在节点    Python
5 条回复
hushao
2020-02-19 16:56:41 +08:00
确认是 uwsgi ?
python30
2020-02-19 17:36:31 +08:00
@hushao 应该是。只要停止 uwsgi 就能正常重启
python30
2020-02-19 18:32:44 +08:00
@hushao
发现了个问题
我是 centos7.6 系统

如果不用 /etc/rc.d/rc.local 在这里面启动设置开机自启动 uwsgi
开机进去手动启动 uwsgi 就可以正常重启

但是这样以后重启还要再进服务器手动启动 uwsgi 很麻烦
python30
2020-02-19 19:16:45 +08:00
@python30 自问自答吧。
发现问题就好解决了
不用 /etc/rc.d/rc.local 自启动
用 systemd supervisor 管理 uwsgi 就可以了

至少为什么用 /etc/rc.d/rc.local 不可以了。。。我也很奇怪
kbshr123
2020-07-11 17:31:50 +08:00
一样的问题。开始没找定位,还重装了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/645769

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX