V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
python30
V2EX  ›  Python

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

  •  
  •   python30 · 2020-02-19 12:46:05 +08:00 · 2331 次点击
    这是一个创建于 1521 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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
    ···
    5 条回复    2020-07-11 17:31:50 +08:00
    hushao
        1
    hushao  
       2020-02-19 16:56:41 +08:00 via iPhone
    确认是 uwsgi ?
    python30
        2
    python30  
    OP
       2020-02-19 17:36:31 +08:00
    @hushao 应该是。只要停止 uwsgi 就能正常重启
    python30
        3
    python30  
    OP
       2020-02-19 18:32:44 +08:00
    @hushao
    发现了个问题
    我是 centos7.6 系统

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

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

    至少为什么用 /etc/rc.d/rc.local 不可以了。。。我也很奇怪
    kbshr123
        5
    kbshr123  
       2020-07-11 17:31:50 +08:00
    一样的问题。开始没找定位,还重装了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2829 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 11:52 · PVG 19:52 · LAX 04:52 · JFK 07:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.