Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > windows service problem

Reply
Thread Tools

windows service problem

 
 
JackPhil
Guest
Posts: n/a
 
      10-03-2005
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?

 
Reply With Quote
 
 
 
 
fraca7
Guest
Posts: n/a
 
      10-03-2005
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()
 
Reply With Quote
 
 
 
 
JackPhil
Guest
Posts: n/a
 
      10-03-2005

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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax calls web service in wcf(windows service) Billy Zhang ASP .Net 7 07-31-2008 07:37 AM
How to control Windows Service through Web Service prowyh ASP .Net 0 11-16-2007 04:05 AM
Indexing services under Windows XP SP2 - Can I disable MS Indexing Service to hasten Google's OR does Google Desktop uses this MS Indexing Service? ricardodefaria Computer Support 6 08-05-2007 04:14 AM
Exposing Unmanaged C++ Windows Service code as a ASP.NET service. =?Utf-8?B?c2h5YW0=?= ASP .Net 2 05-22-2006 01:47 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM



Advertisments