linux - Upstart 未能初始化 gunicorn 服务器

标签 linux ubuntu webserver gunicorn upstart

我正在尝试启动一个运行 gunicorn 的服务器实例。这是我的新手脚本:

 expect daemon

 script
     cd /opt/app/live/srv/poi_proxy
     exec /usr/local/bin/gunicorn server:app -c /etc/gunicorn.conf
 end script

这是 gunicorn 配置文件:

 bind =  '0.0.0.0:80'
 workers = 3
 worker_class = 'gevent'

我遇到的问题是,当通过命令提示符运行命令时,服务器启动时没有问题。但是,当使用 upstart 脚本时,它会为每个子进程生成一个已失效的进程。

另外我相信路径必须与它做一些事情。当我通过命令行启动服务器时:

 cd /opt/app/live/srv/poi_proxy
 sudo /usr/local/bin/gunicorn server:app -c /etc/gunicorn.conf

它工作正常,但是:

 sudo /usr/local/bin/gunicorn /opt/app/live/srv/poi_proxy/server:app -c /etc/gunicorn.conf

我遇到了与使用 upstart 时相同的问题 任何关于什么可能是错误的或如何解决它的想法将不胜感激。

最佳答案

看起来这里的部分问题是您在 upstart 配置文件中期望守护进程,但您没有在守护进程模式下调用 gunicorn。这应该会导致 pid 报告不正确以及 initctl stop 命令挂起。

关于linux - Upstart 未能初始化 gunicorn 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11798551/

相关文章:

Linux 使用 lapack 库

c - 下列哪项对 Nagle 算法的描述是正确的?

node.js - 收到错误 : Cannot find module 'errno' running node script

apache - 使用 Java 监控 Apache Web 服务器

linux - pt_regs 结构中的 eax 在哪里?只有斧头存在

Linux:如何捕获进程的标准输出直到结束,但如果出现特定字符串则停止并返回非零代码?

当使用 apt 安装/从源代码编译时,R 会以不同方式处理某些字符

python - 在远程执行 python fabric 命令之前总是给出命令行

internet-explorer - 与其他浏览器相比,在 IE 中加载页面非常慢

java - 没有网络服务器的 JSP 引擎