推荐学习书目
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 · Feb 19, 2020 · 2920 views
    This topic created in 2281 days ago, the information mentioned may be changed or developed.
    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 replies    2020-07-11 17:31:50 +08:00
    hushao
        1
    hushao  
       Feb 19, 2020 via iPhone
    确认是 uwsgi ?
    python30
        2
    python30  
    OP
       Feb 19, 2020
    @hushao 应该是。只要停止 uwsgi 就能正常重启
    python30
        3
    python30  
    OP
       Feb 19, 2020
    @hushao
    发现了个问题
    我是 centos7.6 系统

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

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

    至少为什么用 /etc/rc.d/rc.local 不可以了。。。我也很奇怪
    kbshr123
        5
    kbshr123  
       Jul 11, 2020
    一样的问题。开始没找定位,还重装了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   971 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 20:01 · PVG 04:01 · LAX 13:01 · JFK 16:01
    ♥ Do have faith in what you're doing.