Creating a service/deamon ??

Andrew Bennetts andrew-pythonlist at puzzling.org
Wed May 14 22:49:17 EDT 2003


On Wed, May 14, 2003 at 02:02:08PM +0200, Thomas Weholt ( PRIVAT ) wrote:
> Hi,
> 
> I need to create a long-time running service/deamon that will monitor some
> email-accounts and do certain jobs on given intervals. Preferrably it will
> be able to run as a Windows2000-service, available in the service-manager

You mention that you are already using Twisted; search the twisted-python
mailing list archives for examples of how to run a Twisted app as an NT
service.  To run any python program as an NT service, you'll need the
win32all package.

> and as a deamon started by inetd/xinetd etc on Linunx, just like ordinary
> services.

I don't think inetd is what you meant here -- it doesn't start daemons.  I
think you meant something that runs with the usual init scripts?  If you're
using Twisted on Debian Linux, look at the "tap2deb" script.  Moshe Zadka is
also developing a "twisted-web" package for Debian that includes an init
script you could possibly adapt.  Your best bet here is probably to ask on
the twisted-python list.

> I'm working with Twisted for my web-projects so if I could use that package
> for this it would be nice. A very nice-to-have feature would be to have the
> service available for configuration while running using xmlrpc. If it can be
> done using standard modules in the Python-distro that's even better.

Twisted makes writing an XML-RPC server incredibly easy; see
doc/examples/xmlrpc.py in the Twisted distribution.

-Andrew.






More information about the Python-list mailing list