471,044 Members | 880 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,044 software developers and data experts.

windows service problem

i code a very simple web server with python, and i want it should run
as service on WindowsXP.

the problem is i can run the service in debug mode, and it seems works
fine(i can connect the server with browser), but when i start the
service in the services control panel, i can't connect the server, the
server seems not start, and i can't stop the service.

any advice?

Oct 3 '05 #1
2 1325
JackPhil a écrit :
the problem is i can run the service in debug mode, and it seems works
fine(i can connect the server with browser), but when i start the
service in the services control panel, i can't connect the server, the
server seems not start, and i can't stop the service.


Make sure it doesn't output anything to stdout or stderr, I've run into
problems with that. I always include this kind of code in NT services:

class Devnull:
def write(self, bf):
pass
def close(self):
pass
def flush(self):
pass

sys.stdout = sys.stderr = Devnull()
Oct 3 '05 #2

fraca7 wrote:

Make sure it doesn't output anything to stdout or stderr, I've run into
problems with that. I always include this kind of code in NT services:

class Devnull:
def write(self, bf):
pass
def close(self):
pass
def flush(self):
pass

sys.stdout = sys.stderr = Devnull()


Thanks for your instructions. It's resolved my problem.

Oct 3 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Kris | last post: by
reply views Thread by Scott Davies | last post: by
10 posts views Thread by Ger | last post: by
reply views Thread by Charles Leonard | last post: by
1 post views Thread by Mahesh Devjibhai Dhola | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.