- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在启动我的 gunicorn - 我的服务器上的 Flask 应用程序时遇到问题。
我的服务器是 Ubuntu 14.04 64 位。
当我从终端启动 gunicorn(并激活虚拟环境)时:
gunicorn --bind 0.0.0.0:8000 wsgi
它有效,我可以连接到端口 8000。
但是当我想启动 sudo service MyApp
时,出现以下错误:
start: Job failed to start
我的/etc/init/MyApp.conf 是:
description "Gunicorn application server running MyApp"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid juldou
setgid www-data
env PATH=/home/juldou/MyApp/project_juda/bin
chdir /home/juldou/MyApp
exec gunicorn --workers 3 --bind unix:MyApp.sock -m 007 wsgi
注意:
I know that I don't have created MyApp.sock, I don't know if I must have or this script create MyApp.sock
应该是哪里出了问题?
更新:从终端,此命令正在运行:
(project_juda) juldou@ubuntu-512mb-fra1-01-improveyourself:~/MyApp$ gunicorn --workers 3 --bind unix:MyApp.sock -m 007 wsgi
[2016-05-01 14:06:41 +0000] [8119] [INFO] Starting gunicorn 19.4.5
[2016-05-01 14:06:41 +0000] [8119] [INFO] Listening at: unix:MyApp.sock (8119)
[2016-05-01 14:06:41 +0000] [8119] [INFO] Using worker: sync
[2016-05-01 14:06:41 +0000] [8124] [INFO] Booting worker with pid: 8124
[2016-05-01 14:06:41 +0000] [8127] [INFO] Booting worker with pid: 8127
[2016-05-01 14:06:41 +0000] [8130] [INFO] Booting worker with pid: 8130
[2016-05-01 14:07:28 +0000] [8119] [INFO] Handling signal: int
[2016-05-01 14:07:28 +0000] [8124] [INFO] Worker exiting (pid: 8124)
[2016-05-01 14:07:28 +0000] [8130] [INFO] Worker exiting (pid: 8130)
[2016-05-01 14:07:28 +0000] [8127] [INFO] Worker exiting (pid: 8127)
[2016-05-01 14:07:28 +0000] [8119] [INFO] Shutting down: Master
auth.log:
May 2 11:16:20 ubuntu-512mb-fra1-01-improveyourself sshd[13991]:
pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=212.45.1.10 user=www-data
May 2 11:16:22 ubuntu-512mb-fra1-01-improveyourself sshd[13991]: Failed password for www-data from 212.45.1.10 port 39557 ssh2
May 2 11:16:22 ubuntu-512mb-fra1-01-improveyourself sshd[13991]: Received disconnect from 212.45.1.10: 11: Bye Bye [preauth]
May 2 11:16:44 ubuntu-512mb-fra1-01-improveyourself sshd[13997]: reverse mapping checking getaddrinfo for 50-250-218-65-static.hfc.comcastbusiness.net [50.250.218.65] failed - POSSIBLE BREAK-IN ATTEMPT!
May 2 11:16:44 ubuntu-512mb-fra1-01-improveyourself sshd[13997]: Invalid user squid from 50.250.218.65
May 2 11:16:44 ubuntu-512mb-fra1-01-improveyourself sshd[13997]: input_userauth_request: invalid user squid [preauth]
May 2 11:16:44 ubuntu-512mb-fra1-01-improveyourself sshd[13997]: pam_unix(sshd:auth): check pass; user unknown
May 2 11:16:44 ubuntu-512mb-fra1-01-improveyourself sshd[13997]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=50.250.218.65
May 2 11:16:46 ubuntu-512mb-fra1-01-improveyourself sshd[13997]: Failed password for invalid user squid from 50.250.218.65 port 48021 ssh2
May 2 11:16:46 ubuntu-512mb-fra1-01-improveyourself sshd[13997]: Received disconnect from 50.250.218.65: 11: Bye Bye [preauth]
May 2 11:16:49 ubuntu-512mb-fra1-01-improveyourself sshd[13999]: reverse mapping checking getaddrinfo for 67-219-227-156.mycomspan.com [67.219.227.156] failed - POSSIBLE BREAK-IN ATTEMPT!
May 2 11:16:49 ubuntu-512mb-fra1-01-improveyourself sshd[13999]: Invalid user wordpress from 67.219.227.156
May 2 11:16:49 ubuntu-512mb-fra1-01-improveyourself sshd[13999]: input_userauth_request: invalid user wordpress [preauth]
May 2 11:16:49 ubuntu-512mb-fra1-01-improveyourself sshd[13999]: pam_unix(sshd:auth): check pass; user unknown
May 2 11:16:49 ubuntu-512mb-fra1-01-improveyourself sshd[13999]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=67.219.227.156
May 2 11:16:52 ubuntu-512mb-fra1-01-improveyourself sshd[13999]: Failed password for invalid user wordpress from 67.219.227.156 port 37151 ssh2
May 2 11:16:52 ubuntu-512mb-fra1-01-improveyourself sshd[13999]: Received disconnect from 67.219.227.156: 11: Bye Bye [preauth]
syslog:
May 2 07:17:01 ubuntu-512mb-fra1-01-improveyourself CRON[12670]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 2 08:17:01 ubuntu-512mb-fra1-01-improveyourself CRON[12920]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 2 09:17:01 ubuntu-512mb-fra1-01-improveyourself CRON[13174]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 2 10:17:01 ubuntu-512mb-fra1-01-improveyourself CRON[13473]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 2 11:05:55 ubuntu-512mb-fra1-01-improveyourself kernel: [167847.860083] init: Failed to spawn MyApp main process: unable to execute: No such file or directory
May 2 11:07:02 ubuntu-512mb-fra1-01-improveyourself kernel: [167915.147641] init: Failed to spawn MyApp main process: unable to execute: No such file or directory
May 2 11:07:12 ubuntu-512mb-fra1-01-improveyourself kernel: [167925.023643] init: Failed to spawn MyApp main process: unable to execute: No such file or directory
May 2 11:07:50 ubuntu-512mb-fra1-01-improveyourself kernel: [167963.214775] init: Failed to spawn MyApp main process: unable to execute: No such file or directory
May 2 11:15:49 ubuntu-512mb-fra1-01-improveyourself kernel: [168442.437658] init: Failed to spawn MyApp main process: unable to execute: No such file or directory
May 2 11:16:29 ubuntu-512mb-fra1-01-improveyourself kernel: [168481.799393] init: Failed to spawn MyApp main process: unable to execute: No such file or directory
May 2 11:17:01 ubuntu-512mb-fra1-01-improveyourself CRON[14004]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
UPDATE:
(project_juda) juldou@ubuntu-512mb-fra1-01-improveyourself:~/MyApp/project_juda/bin$ ls
MyApp.sock activate activate.fish easy_install markdown_py pip3 pwiz.py python python3 wheel
__pycache__ activate.csh activate_this.py easy_install-3.4 pip pip3.4 pygmentize python-config python3.4
(project_juda) juldou@ubuntu-512mb-fra1-01-improveyourself:~/MyApp/project_juda/bin$ deactivate
juldou@ubuntu-512mb-fra1-01-improveyourself:~/MyApp/project_juda/bin$ gun
gunicorn gunicorn_django gunicorn_paster gunzip
juldou@ubuntu-512mb-fra1-01-improveyourself:~/MyApp/project_juda/bin$ gunicorn --workers 3 --bind unix:MyApp.sock -m 007 wsgi
[2016-05-02 11:44:31 +0000] [14195] [INFO] Starting gunicorn 19.4.5
[2016-05-02 11:44:31 +0000] [14195] [INFO] Listening at: unix:MyApp.sock (14195)
[2016-05-02 11:44:31 +0000] [14195] [INFO] Using worker: sync
[2016-05-02 11:44:31 +0000] [14200] [INFO] Booting worker with pid: 14200
[2016-05-02 11:44:31 +0000] [14200] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 515, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 122, in init_process
self.load_wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 130, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 357, in import_app
__import__(module)
ImportError: No module named wsgi
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 515, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 122, in init_process
self.load_wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 130, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 357, in import_app
__import__(module)
ImportError: No module named wsgi
[2016-05-02 11:44:31 +0000] [14200] [INFO] Worker exiting (pid: 14200)
[2016-05-02 11:44:31 +0000] [14195] [INFO] Shutting down: Master
[2016-05-02 11:44:31 +0000] [14195] [INFO] Reason: Worker failed to boot.
最佳答案
我觉得行
chdir /home/juldou/MyApp
不会将目录更改为 wsgi
所在的位置。
尝试将 /home/juldou/MyApp
更改为您可以从终端运行它的路径。
关于python - gunicorn:开始:作业无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36966692/
我通过 spring ioc 编写了一些 Rest 应用程序。但我无法解决这个问题。这是我的异常(exception): org.springframework.beans.factory.BeanC
我对 TestNG、Spring 框架等完全陌生,我正在尝试使用注释 @Value通过 @Configuration 访问配置文件注释。 我在这里想要实现的目标是让控制台从配置文件中写出“hi”,通过
为此工作了几个小时。我完全被难住了。 这是 CS113 的实验室。 如果用户在程序(二进制计算器)结束时选择继续,我们需要使用 goto 语句来到达程序的顶部。 但是,我们还需要释放所有分配的内存。
我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出: Error code:
使用 Spring Initializer 创建一个简单的 Spring boot。我只在可用选项下选择 DevTools。 创建项目后,无需对其进行任何更改,即可正常运行程序。 现在,当我尝试在项目
所以我只是在 Mac OS X 中通过 brew 安装了 qt。但是它无法链接它。当我尝试运行 brew link qt 或 brew link --overwrite qt 我得到以下信息: ton
我在提交和 pull 时遇到了问题:在提交的 IDE 中,我看到: warning not all local changes may be shown due to an error: unable
我跑 man gcc | grep "-L" 我明白了 Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more inf
我有一段代码,旨在接收任何 URL 并将其从网络上撕下来。到目前为止,它运行良好,直到有人给了它这个 URL: http://www.aspensurgical.com/static/images/a
在过去的 5 个小时里,我一直在尝试在我的服务器上设置 WireGuard,但在完成所有设置后,我无法 ping IP 或解析域。 下面是服务器配置 [Interface] Address = 10.
我正在尝试在 GitLab 中 fork 我的一个私有(private)项目,但是当我按下 fork 按钮时,我会收到以下信息: No available namespaces to fork the
我这里遇到了一些问题。我是 node.js 和 Rest API 的新手,但我正在尝试自学。我制作了 REST API,使用 MongoDB 与我的数据库进行通信,我使用 Postman 来测试我的路
下面的代码在控制台中给出以下消息: Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child el
我正在尝试调用一个新端点来显示数据,我意识到在上一组有效的数据中,它在数据周围用一对额外的“[]”括号进行控制台,我认为这就是问题是,而新端点不会以我使用数据的方式产生它! 这是 NgFor 失败的原
我正在尝试将我的 Symfony2 应用程序部署到我的 Azure Web 应用程序,但遇到了一些麻烦。 推送到远程时,我在终端中收到以下消息 remote: Updating branch 'mas
Minikube已启动并正在运行,没有任何错误,但是我无法 curl IP。我在这里遵循:https://docs.traefik.io/user-guide/kubernetes/,似乎没有提到关闭
每当我尝试docker组成任何项目时,都会出现以下错误。 我尝试过有和没有sudo 我在这台机器上只有这个问题。我可以在Mac和Amazon WorkSpace上运行相同的容器。 (myslabs)
我正在尝试 pip install stanza 并收到此消息: ERROR: No matching distribution found for torch>=1.3.0 (from stanza
DNS 解析看起来不错,但我无法 ping 我的服务。可能是什么原因? 来自集群中的另一个 Pod: $ ping backend PING backend.default.svc.cluster.l
我正在使用Hibernate 4 + Spring MVC 4当我开始 Apache Tomcat Server 8我收到此错误: Error creating bean with name 'wel
我是一名优秀的程序员,十分优秀!