- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 dotcloud 上设置一个 twistd 守护进程:
我的 supervisord.conf 文件:
[program:apnsd]
command=/home/dotcloud/env/bin/twistd --logfile /var/log/supervisor/apnsd.log apnsd -c gp_config.py
directory=/home/dotcloud/current/apnsd
但是,它看起来像命令“提前退出”,然后提示 Supervisor 尝试重新启动,然后失败,因为 twistd dameon 正在后台运行。
来自监督日志:
more supervisord.log
2012-05-19 03:07:52,723 CRIT Set uid to user 1000
2012-05-19 03:07:52,723 WARN Included extra file "/etc/supervisor/conf.d/uwsgi.c
onf" during parsing
2012-05-19 03:07:52,723 WARN Included extra file "/home/dotcloud/current/supervi
sord.conf" during parsing
2012-05-19 03:07:52,922 INFO RPC interface 'supervisor' initialized
2012-05-19 03:07:52,922 WARN cElementTree not installed, using slower XML parser
for XML-RPC
2012-05-19 03:07:52,923 CRIT Server 'unix_http_server' running without any HTTP
authentication checking
2012-05-19 03:07:52,932 INFO daemonizing the supervisord process
2012-05-19 03:07:52,934 INFO supervisord started with pid 144
2012-05-19 03:07:53,941 INFO spawned: 'apnsd' with pid 147
2012-05-19 03:07:53,949 INFO spawned: 'uwsgi' with pid 149
2012-05-19 03:07:54,706 INFO exited: apnsd (exit status 0; not expected)
2012-05-19 03:07:55,712 INFO spawned: 'apnsd' with pid 175
2012-05-19 03:07:55,712 INFO success: uwsgi entered RUNNING state, process has s
tayed up for > than 1 seconds (startsecs)
2012-05-19 03:07:56,261 INFO exited: apnsd (exit status 1; not expected)
2012-05-19 03:07:58,267 INFO spawned: 'apnsd' with pid 176
2012-05-19 03:07:58,783 INFO exited: apnsd (exit status 1; not expected)
2012-05-19 03:08:01,790 INFO spawned: 'apnsd' with pid 177
2012-05-19 03:08:02,840 INFO success: apnsd entered RUNNING state, process has s
tayed up for > than 1 seconds (startsecs)
来自 apnsd 日志:
dotcloud@hack-default-www-0:/var/log/supervisor$ more apnsd-stderr---supervisor
-m7GnKV.log
INFO:root:Reactor Type: <twisted.internet.pollreactor.PollReactor object at 0x10
a09d0>
DEBUG:root:Creating listener: apnsd.listeners.line.LineProtocolFactory
INFO:root:Listening on Line Protocol on :1055
DEBUG:root:Listener Created: <apnsd.listeners.line.LineProtocolFactory instance
at 0x12fc8c0>
DEBUG:root:Creating App Factory: apnsd.daemon.APNSFactory
INFO:root:Connecting to APNS Server, App: apns_dev:AAA.com.company.www
INFO:root:apns_dev:AAA.com.company.www -> Started connecting to APNS con
nector...
INFO:root:Registering Application: apns_dev:GoParcel...
DEBUG:root:Creating App Factory: apnsd.daemon.APNSFactory
INFO:root:Connecting to APNS Server, App: apns_dev:T365ED94A9.com.appitems.parce
ls
INFO:root:apns_dev:T365ED94A9.com.appitems.parcels -> Started connecting to APNS
connector...
INFO:root:Registering Application: apns_dev:GoParcelVictor...
Another twistd server is running, PID 172
This could either be a previously started instance of your application or a
different application entirely. To start a new one, either run it in some other
directory, or use the --pidfile and --logfile parameters to avoid clashes.
Another twistd server is running, PID 172
--More--(42%)
worker的状态是failed:
./dotcloud run hack.worker supervisorctl status
USER PATH IS: C:\Users\Taras/.dotcloud\dotcloud.conf
# supervisorctl status
apnsd FATAL Exited too quickly (process log may
have details)
但是 twistd 进程在那里(ps -ef):
dotcloud 171 1 0 03:13 ? 00:00:00 /home/dotcloud/env/bin/python /home/dotcloud/env/bin/twistd --logfile /var/log/supervisor/apnsd.log apnsd -c gp_config.py
我在尝试通过包装脚本启动进程时遇到了类似的问题(并使用 exec 以便不创建子进程)。我做错了什么?
最佳答案
Supervisor 希望受控进程保留在前台,但 twistd
默认 fork 到后台。 Supervisor因此认为它已经退出,并尝试重新启动它。
您应该使用--nodaemon
选项启动twistd
:twistd
将保留在前台,Supervisor 会很高兴!
关于dotcloud supervisord twistd 提前退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10662044/
显然,您可以通过两种不同的方式创建使用 Twisted 的 twistd 运行的服务。一方面,您可以使用 Twisted Application Infrastructure 创建服务在另一个中,您可
我正在尝试开发一个 Twisted Web 服务器,但似乎无法运行 twistd 命令。我试过设置 python 路径,甚至在我的路径中包含了 twistd.py 脚本的路径,但似乎没有任何效果。 我
我有一个守护进程,它监听 /var/run 中的套接字。我使用 init 脚本(显然以 root 身份)启动守护进程,并且使用 twistd --uid 和 --gid删除非特权用户特权的选项。然而,
请考虑以下测试用例。 项目目录结构如下: foo ├── foo │ ├── __init__.py │ └── bar.py └── test.tac bar.py包含一个简单的类定义: #
我正在尝试在 dotcloud 上设置一个 twistd 守护进程: 我的 supervisord.conf 文件: [program:apnsd] command=/home/dotcloud/en
有没有一种方法可以在扭曲中不阻塞地压缩文件? import zipfile from twisted.internet import defer from twisted.internet impor
我正在使用 twistd.py 来运行我的应用程序,如下所示: twistd -noy -l logfile.log tacfile.tac 不幸的是,现在所有的输出都进入了日志文件,这对于过去的调试
我对 twistd 日志系统的主要特性很感兴趣,我正在使用它来记录一些我需要的数据,更多的是记录 twisted 应用程序的真实状态。顺便说一句,它很吵,我读过这个Twisted: disable l
我使用 autobahn 库在 Twisted 上开发了一个 websocket 服务器。现在我想用 twistd 将它作为守护进程运行。对于简单的 TCP 服务器,我会做类似的事情: applica
我有一个 jabber 客户端,它正在读取其标准输入并发布 PubSub 消息。如果我在 stdin 上收到 EOF,我想终止客户端。 我首先尝试了sys.exit(),但这会导致异常,客户端不会退出
我真正喜欢 django 的事情之一是当您编辑项目时服务器自动重置的方式。我最近开始在twisted/cyclone 中进行一些开发。 有没有类似的方法可以让twistd在程序文件更改时自动重置? 最
在命令提示符下输入 >>twistd echobot.tac Traceback (most recent call last): File "C:\Python26\Scripts\twistd
几天前,我尝试学习python twisted.. 这就是我制作网络服务器的方式: from twisted.application import internet, service from twi
这是我的 twistd 插件的当前状态,它位于 project_root/twisted/plugins/my_plugin.py: #!/usr/bin/env python # -*- codin
我有一个 Twisted 守护程序应用程序,它可以在使用 twistd 的 Python 2 上运行而不会引发任何问题。但是,我也想支持 Python3,虽然我所有的代码都可以工作,但似乎 twist
使用twistd相对于nohup有什么优点? 为什么要这么做 twistd -y service.tac 当我能做的时候: nohup sudo python my_app.py & ? 我问这个问题
我有一个使用 psutil 的 Python 程序运行一些不同的 twistd ... 命令。 twistd 生成并守护进程并写入一个 foo.pid,我可以从中读取 pid。 它还进行了设置,以便在
我有一个 Pyramid 应用程序,其中也有一些 Twisted 代码,所以我想使用 twistd 为该应用程序提供服务,以一石二鸟。 这是我的 .tac 文件: from twisted.web.s
我创建了一个不错的 python Twisted 应用程序,其中包含一个用于 twistd 运行器的插件,如 Twisted 文档中所述:http://twistedmatrix.com/docume
当我像这样运行扭曲的应用程序时: twistd --pidfile ./twistd.pid -l $HOME/logs/my_application.log -oy service.tac 我发现它
我是一名优秀的程序员,十分优秀!