[Twisted-Python] tap2ntsvc in sandbox
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Twisted/sandbox/moonfallen/tap2ntsvc.py If you have an Twisted application that you want to make into a service on Windows, give this a try. It's very basic right now; it absolutely needs py2exe and Inno setup support before I'll consider it done. The goal is to have the output be a complete binary package analogous to the output of tap2deb or tap2rpm. The only difference will be that, instead of depending on software like the Linux versions do, it will do as much as it can to help you include the dependencies in the package using py2exe. Right now, nothing beyond generating a service script is done. Here's the help: Usage: tap2ntsvc.py [options] <filename> Options: ~ -y, --type= Config file type: pickle, xml, source, or python ~ -o, --output-file= Name of the setup executable produced ~ -n, --name= Short name of the service (used with "net start") ~ -d, --display-name= Human-readable name of the service ~ -e, --description= Description of the service ~ -r, --reactor= Reactor to install (like twistd) [default: default] ~ --version ~ --help Display this help and exit. Do something like . . . | python tap2ntsvc.py myapp.tac The output is myappsvc.py (or <name>svc.py). Then you run myappsvc.py: | python myappsvc.py install Installing service myapp to Python class C:\myapp\myappsvc.myapp_ServiceControl Changing service configuration Service updated | net start myapp The myapp run by Twisted service is starting. The myapp run by Twisted service was started successfully. Give it a try, let me know if you have any problems with it. Thanks, C -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3-nr1 (Windows XP) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQE/senW3A5SrXAiHQcRAvNdAJ4n7+yfvB/kcKD1pfGjfgqDbFgqcACcCDYZ jqd+gw+guZ3xg4f5R6I8tIQ= =kTlI -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I should add that, if you do have any problems using it (e.g. net start doesn't work), check the Application Log in Event Viewer. There should be a helpful traceback in an Error event. C Cory Dodt wrote: | Twisted/sandbox/moonfallen/tap2ntsvc.py | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3-nr1 (Windows 2000) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQE/snHm3A5SrXAiHQcRAkKHAJ43fuZ92WgpymWtgs0jBi3SEmIsFACeKHnE OWPpZLdta3C2vuKhQuGSuEg= =6bkB -----END PGP SIGNATURE-----
One problem I had with a python windows service in general ended up being related to the following tech note. Took me forever to figure out what the problem was, but every one of the symptoms in the tech note applied. I'm posting this to hopefully save other's the headache. The immediate output you see is as follows: E:\scripts>winsvc.py start Starting service RatControlService Error starting service: The service did not respond to the start or control request in a timely fashion. E:\scripts> More info was available in the event logs as described in the tech note. http://support.microsoft.com/default.aspx?scid=kb;en-us;812485 -Justin On Wed, 12 Nov 2003 09:46:14 -0800, "Cory Dodt" <corydodt@twistedmatrix.com> said:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I should add that, if you do have any problems using it (e.g. net start doesn't work), check the Application Log in Event Viewer. There should be a helpful traceback in an Error event.
C
Cory Dodt wrote: | Twisted/sandbox/moonfallen/tap2ntsvc.py | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3-nr1 (Windows 2000) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQE/snHm3A5SrXAiHQcRAkKHAJ43fuZ92WgpymWtgs0jBi3SEmIsFACeKHnE OWPpZLdta3C2vuKhQuGSuEg= =6bkB -----END PGP SIGNATURE-----
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (3)
-
Abe Fettig -
Cory Dodt -
Justin Johnson