Opened 6 years ago

Last modified 4 years ago

#3434 enhancement new

There should be an example init.d script for running twistd as a service on Ubuntu in doc/core/examples

Reported by: radix Owned by: polvi
Priority: normal Milestone:
Component: core Keywords: documentation twistd
Cc: riteshn@… Branch:
Author: Launchpad Bug:

Description

We should add one to doc/core/examples. It should basically only require the modification of the calls to 'twistd' and run on a modern Ubuntu machine (but not depend on more exotic things like Upstart).

Attachments (2)

twistdplugin (1.7 KB) - added by powdahound 5 years ago.
Sample init.d script for a twisted plugin on Ubuntu
foobarplugin (1.3 KB) - added by polvi 5 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 6 years ago by exarkun

  • Summary changed from An example init.d script would be excessively helpful to An example init.d script would be helpful

comment:2 Changed 6 years ago by glyph

  • Summary changed from An example init.d script would be helpful to There should be an example init.d script for running twistd as a service on Ubuntu in doc/core/examples

adjusting the summary to be a bit more descriptive of what should happen.

comment:3 Changed 6 years ago by LordVan

Something like this exists in gentoo alread and is installed with twisted core:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/twisted/files/twistd.init?rev=1.1&view=markup

http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/twisted/files/twistd.conf?rev=1.1&view=markup

I'm considering enhancing this to run as diff. users and / or more than 1 diff. twistd

comment:4 Changed 6 years ago by glyph

Thanks LordVan, that's a good start. Is this compatible with Ubuntu's startup?

I'm not sure I like the use of conf.d and TWISTD_OPTS, but I don't have a better suggestion at the moment.

comment:5 Changed 6 years ago by exarkun

This is interesting. It seems that this is a singleton approach to a twistd init.d script. Is the intended use for all Twisted services to be added to a single .tac or .tap file and for it to be managed with this script? Or are changes supposed to be made to each of these files to create a new init.d script for each service to be run?

comment:6 Changed 5 years ago by LordVan

well as you want to I guess. as I said i want to change it so that I can start more than one service using one init.d/twisted script by adding more conf.d/twisted entries somehow

comment:7 Changed 5 years ago by LordVan

Just a note: I did not forget about this just been busy and/or slacking .. promise I'll get onto this asap

Changed 5 years ago by powdahound

Sample init.d script for a twisted plugin on Ubuntu

comment:8 Changed 5 years ago by powdahound

Just wanted to share a sample init script I'm using on Ubuntu to run a service for a twistd plugin I wrote. See the twistdplugin attachment. Comments welcome. I'm not too knowledgeable about twistd or init scripts.

Changed 5 years ago by polvi

comment:9 Changed 5 years ago by polvi

foobarplugin is an init script (based on powdahound's) that will start an arbitrary twistd plugin, based on the name of the init.d script.

If your plugin is named "foo", copy this to /etc/init.d/foo, and you will get an init script that starts/stops the twistd plugin "foo". It assumes that your twistd plugin is already in the python path.

comment:10 Changed 5 years ago by glyph

  • Owner changed from glyph to polvi

Any chance you could convert this into a real patch?

comment:11 Changed 4 years ago by exarkun

  • Keywords documentation twistd added

comment:12 Changed 4 years ago by psykidellic

  • Cc riteshn@… added
Note: See TracTickets for help on using tickets.