- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在运行一个带有 nginx 的 Debian 网络服务器,而 gunicorn 运行一个 django 应用程序。我已经启动并运行得很好,但在重新启动服务器后,我收到 502 错误的网关错误。我已经将问题追溯到重启后 gunicorn 处于非事件状态。如果我启动该服务,问题就会得到解决,直到我再次重新启动服务器。
启动服务:
systemctl start gunicorn.service
重启后这里是我的 gunicorn 服务状态:
{username}@instance-3:~$ sudo systemctl status gunicorn
● gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled)
Active: inactive (dead)
我的/etc/systemd/system/gunicorn.service 文件的内容:
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User={username}
Group={username}
WorkingDirectory=/home/{username}/web/{projname}
ExecStart=/usr/local/bin/gunicorn {projname}.wsgi:application
Restart=on-failure
[Install]
WantedBy=multi.user.target
有什么想法可以弄清楚为什么 gunicorn 服务在重启后没有启动吗?
编辑:
问题可能是 gunicorn.conf 在 chdir 和 exec 中的目录与工作目录不同吗?
{username}@instance-3:~$ cat /etc/init/gunicorn.conf
cription "Gunicorn application server handling {projname}"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid {username}
setgid {username}
chdir /home/data-reporting/draco_reporting
exec {projname}/bin/gunicorn --workers 3 --bind unix:/home/{username}/data-reporting/{projname}/{projname}.sock {projname}.wsgi:application
最佳答案
您的 gunicorn.service
文件中有一个小错字。更改为:
WantedBy=multi-user.target
此外,您可能希望更改为:
Restart=always
关于linux - gunicorn 开机后不启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43857549/
我在阅读 linux/arch/arm/boot/compressed/head.S 我想通了天使靴。第一次接触这个词 #ifndef CONFIG_CPU_V7M /*
启动时是否调用了 onUpdate AppWidget? 我在 onUpdate 中设置了一个警报,我想知道 onUpdate 是否会在启动时被调用,或者我应该使用 BOOT_COMPLETED In
我需要更改 android 电视盒默认启动 Logo 图像。设备具有 root 访问权限,我尝试使用 change /系统/媒体/图像 并更改 initlogo.720p.rle 但我没有成功 最佳答
我是一名优秀的程序员,十分优秀!