Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   windows service problem (http://www.velocityreviews.com/forums/t349805-windows-service-problem.html)

JackPhil 10-03-2005 09:14 AM

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?


fraca7 10-03-2005 09:43 AM

Re: windows service problem
 
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()

JackPhil 10-03-2005 11:00 AM

Re: windows service problem
 

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.



All times are GMT. The time now is 12:50 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.