`twistd` is an utility that can be used to run twisted applications. It's shipped with `twisted` itself and it automatically takes care for you of logging, daemonizing, permissions and more; while still allowing you to configure all of these. Use this tag for questions about usage and problems with twistd command, pay attention to the difference between `twistd` and `twisted` and DO NOT use this tag for general twisted-related questions.
Questions tagged [twistd]
53 questions
7
votes
1 answer
What's the difference between a twistd plugin and a twistd service?
Apparently you can create services that are run with Twisted's twistd in two different ways. On the one hand you can create services using the Twisted Application Infrastructure and in the other you can create a service using the Twisted Plugin…

Bjorn
- 69,215
- 39
- 136
- 164
6
votes
1 answer
Running twistd with Pypy
I'm trying Pypy because it shows impressive benchmarks over CPython. Also, I'm mostly using the Twisted library in my code. I can now run a benchmark script which uses the Twisted reactor so I guess my setup is good. However, I do not know how to…

esamson
- 140
- 3
- 8
5
votes
1 answer
Twisted script issue
I have written a Twisted bin file that is deployed on /usr/bin during application deployement, based on the Axiom example provided elsewhere on StackOverflow (I don't remember where), the project can be found here.
My problem is that, during the…

kitensei
- 2,510
- 2
- 42
- 68
5
votes
1 answer
Packaging a twistd plugin using pyinstaller
I created a nice python Twisted app with a plugin for the twistd runner, as specified in the Twisted Documentation: http://twistedmatrix.com/documents/current/core/howto/tap.html. I am having problems packaging this with PyInstaller: my twistd…

Martijn Rutten
- 763
- 6
- 14
4
votes
1 answer
What does `import _preamble` do in Python?
I notice the following at the top of Twisted's twistd.py script:
import os, sys
try:
import _preamble
except ImportError:
sys.exc_clear()
sys.path.insert(0, os.path.abspath(os.getcwd()))
What does import _preamble do? I can't seem to find…

Claudiu
- 224,032
- 165
- 485
- 680
3
votes
1 answer
Check if Twisted Server launched with twistd was started successfully
I need a reliable way to check if a Twisted-based server, started via twistd (and a TAC-file), was started successfully. It may fail because some network options are setup wrong. Since I cannot access the twistd log (as it is logged to /dev/null,…

Wolkenarchitekt
- 20,170
- 29
- 111
- 174
3
votes
1 answer
Twisted: disable logging of Twisted-framework classes
My Twisted-based client sends UDP packets in a loop.
Therefore I'm using the class DatagramProtocol.
This is the source:
#!/usr/bin/python
# -*- coding: utf-8 -*-
from twisted.application.service import Service
from twisted.internet import…

Wolkenarchitekt
- 20,170
- 29
- 111
- 174
3
votes
1 answer
Flask deployment using twistd
In the flask doco the following description is shown of deploying a flask app under twistd.
twistd web --wsgi myproject.app
I have a foo.py which looks like this
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
…

glaucon
- 8,112
- 9
- 41
- 63
3
votes
2 answers
Why can't twistd import a module from it's current working directory?
Please consider the following test case.
The project directory is structured thusly:
foo
├── foo
│ ├── __init__.py
│ └── bar.py
└── test.tac
bar.py contains a trivial class definition:
# bar.py
class Bar:
pass
test.tac, the Twisted…

Louis Thibault
- 20,240
- 25
- 83
- 152
3
votes
1 answer
Twisted. How to write a unique prefix to the log for each request
I have twisted server. It is run with plugin. I want to write unique prefix for each entry depending on the request.
This means that when user1 make a request, it will generate a unique string that will be prefixed the log records (only for this…

mastak
- 343
- 3
- 11
2
votes
1 answer
Twisted plugin logging
I am creating a twisted plugin. There is documentation here about how to control logging for twisted apps in .tac files. However there is no similar documentation for controlling logging for plugins.
Since plugins do not create Application()…

vsekhar
- 5,090
- 5
- 22
- 23
2
votes
1 answer
Buildbot does not start with default configuration
Thought I'd give buildbot a try. So I followed the tutorial, doing these:
sudo pip install virtualenv 'buildbot[bundle]'
virtualenv bb-master
source bb-master/bin/activate
buildbot create-master master
buildbot start
All goes well until that…

Jonny
- 842
- 5
- 14
2
votes
1 answer
twistd and nohup &: what is the difference?
What are the advantages of using twistd over nohup?
Why doing
twistd -y service.tac
when I can do:
nohup sudo python my_app.py &
?
I am asking this because I faced a difficulty to use twistd, see my question here

Mostafa
- 1,501
- 3
- 21
- 37
2
votes
1 answer
Twisted plugin error
A have created a dead simple twisted application that starts a TCP protocol and echo out what you type in STDIN.
I am now trying to create a twistd plugin to be able to run my application this way: echo start or either twistd -n echo
When running…

kitensei
- 2,510
- 2
- 42
- 68
2
votes
1 answer
Twisted Python - twistd - How to remove old log files
I am using twistd to run my application, and I read how to customize the logger. However, I can't seem to figure out how to get the default logger (-l option, uses sequential integers for extensions) or the DailyLogFile to limit the number of…

Carl
- 695
- 8
- 21