`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
2
votes
1 answer
Why is my twisted plugin not appearing when I run the `twistd` command with no options?
Here is the current state of my twistd plugin, which is located in project_root/twisted/plugins/my_plugin.py:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from zope.interface import implements
from twisted.plugin import IPlugin
from…

Louis Thibault
- 20,240
- 25
- 83
- 152
2
votes
1 answer
How to modify the twisted log format?
I use the twisted's DailyLogFile,and run like this:
twistd --logfile=test.log myserver_tapname
The log file like this:
test.log.2014_3_9
But i hope the log like this:
test.log.2014_03_09
How can I format that output filename?
Thanks!

flyking_
- 161
- 1
- 5
2
votes
1 answer
User / Application specific values in Twisted .tac file
What's the best practice for putting additional configuration items, specific to my application, in a twistd ".tac" file? How do I access these items from inside my class?
Is there some property in the "application" object that's intended to store…

Thrill Science
- 408
- 4
- 14
2
votes
1 answer
How to set twistd.py ILogObserver when using IPlugin?
I want to redirect twistd.py's logging to python's logging. When starting a .tac file normally I can easily do this:
from twisted.python.log import PythonLoggingObserver, ILogObserver
from twisted.application import service
application =…

Claudiu
- 224,032
- 165
- 485
- 680
2
votes
1 answer
twistd.py log to both stdout and file
I'm using twistd.py to run my application as follows:
twistd -noy -l logfile.log tacfile.tac
The unfortunate thing with this is that all output now goes to the log file, which is better for debugging things in the past but worse for debugging…

Claudiu
- 224,032
- 165
- 485
- 680
2
votes
1 answer
Unclean exist with twisted+wxPython
I'm using twistd. Here is the sole service in the application:
class GameClientService(internet.TCPClient):
def __init__(self, serverHost, serverPort):
self.wxApp = wx.App(False)
reactor.registerWxApp(self.wxApp)
…

Claudiu
- 224,032
- 165
- 485
- 680
2
votes
2 answers
How to reliably get pid of twistd spawned process?
I have a Python program that uses psutil to run some various twistd ... commands. twistd spawns and daemonizes a process and writes a foo.pid from which I can read the pid.
It also sets up so that this pid-file is cleaned up when the process…

porgarmingduod
- 7,668
- 10
- 50
- 83
2
votes
1 answer
Run autobahn application with twistd
I've developed a websocket server on Twisted with autobahn lib. Now I want to run it as a daemon with twistd. In case of simple TCP server I would do something like that:
application = service.Application("someapp") # create the…

Andrew Chernov
- 41
- 5
1
vote
1 answer
Run Non-Twisted-based Python script daemonized with twistd
I'm writing a Python program consisting of a server (using Twisted) and a client (without Twisted)
The server part is implemented using Twisted and Twisted's application framework and launched with Twistd to be daemonized.
The client which runs on a…

Wolkenarchitekt
- 20,170
- 29
- 111
- 174
1
vote
0 answers
Plugin doesn't show up when running twistd
I created a test twistd plugin following the MyProject example here:
https://twistedmatrix.com/documents/current/core/howto/tap.html
but when I run twistd --help from the project root, the myproject program doesn't appear.
twistd --version…

bitcoinvenv
- 11
- 1
1
vote
1 answer
How deploy Twistd https application (.tac) with systemd as unprivileged user?
My https(port 443) twistd application (.tac) works fine deployed as a systemd service but the unit file requires user:root to listen/bind ports below 1000. The problem is that twistd runs also as user:root.
How to listen/bind port 443 then hand-off…

antonymott
- 113
- 1
- 9
1
vote
1 answer
run in twistd instead of python
I need to debug my twisted application. I am using pycharm and from what I understand I can start my application in twistd with the --no-daemon option in order to step through the code.
I have the following code to start the server.
def main():
…

user1601716
- 1,893
- 4
- 24
- 53
1
vote
0 answers
Twistd swallowing exceptions
I have basically copied this example. Just trying to get the most basic to work: publishing and consuming. Hence have added a simple basic_publish.
consumer.py
# -*- coding:utf-8 -*-
import pika
from pika import exceptions
from pika.adapters import…

kev
- 8,928
- 14
- 61
- 103
1
vote
0 answers
Check if initializing of a twisted service using twistd failed with an error
Using twistd plugin system I launch Twisted applications. With the help of this SO answer, I've implemented a PID file (where the process ID is written into it) to determine if a daemon has been successfully started or not.
The monitoring of the…

RHLK
- 347
- 3
- 14
1
vote
1 answer
Starting python Klein using twistd throws no module Error
Hi, I am trying to start a Klein server using twistd method. I
tried it by reading the Klein documentation.
But when I tried to start the server, it says no module found.
Here is the sample code of what i tried,
helloworld.py :
from klein import…

Karthikeyan KR
- 1,134
- 1
- 17
- 38