与配置文件一起使用时如何重新启动gunicorn

问题描述 投票:0回答:1

我正在使用gunicorn 来服务django 应用程序。我正在使用配置文件并使用命令启动gunicorn

gunicorn -c config/gunicorn/dev.py

我想知道如何重启gunicorn。我无法使用 sudo systemctl restart Gunicorn 命令,该命令给出以下消息:

无法重新启动gunicorn.service:找不到单位gunicorn.service。

我非常确定 Gunicorn 正在运行,因为我可以在网络上使用该应用程序。这种情况下重启gunicorn的方法是什么?

以下是gunicorn的配置文件:

# Django WSGI application path in pattern MODULE_NAME:VARIABLE_NAME
wsgi_app = "someapp.wsgi:application"
# The granularity of Error log outputs
loglevel = "debug"
# The number of worker processes for handling requests
workers = 2
# The socket to bind
bind = "0.0.0.0:8000"
# Restart workers when code changes (development only!)
reload = True
# Write access and error info to /var/log
accesslog = errorlog = "/var/log/gunicorn/dev.log"
# Redirect stdout/stderr to log file
capture_output = True
# PID file so you can easily fetch process ID
pidfile = "/var/run/gunicorn/dev.pid"
# Daemonize the Gunicorn process (detach & enter background)
daemon = True
django gunicorn
1个回答
0
投票

我想通了。我们需要运行命令 sudo Killall Gunicorn。然后我们可以使用命令 gunicorn -c Gunicornconfigfile

重新启动 Gunicorn
© www.soinside.com 2019 - 2024. All rights reserved.