471,354 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

windows service

I'm trying to get a program that uses M2Crypto ThreadingSSLServer to
run in windows as a service. I have a few problem, it doesn't listen
on its port and I don't know how to debug it.

I used the pipeservice example as a framework to get it running as a
service

def SvcDoRun(self):
# Write an event log record - in debug mode we will also
# see this message printed.
servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE,
servicemanager.PYS_SERVICE_STARTED,
(self._svc_name_, '')
)

daemonserver = do_daemon()
while 1:
daemonserver.handle_request()

I think I need a way to break out of that while loop when a service
stop is sent, but not knowing what happening at that point I'm not
sure how. It's not even listening on its port.

daemonserver is

daemonserver = SSL.ThreadingSSLServer((host_ip_addr, int
(host_port_num)), TestRequestHandler, ctx)

any help?

--
Michael Chesterton
http://chesterton.id.au/blog/
http://barrang.com.au/

--
Michael Chesterton
http://chesterton.id.au/blog/
http://barrang.com.au/

Jan 8 '08 #1
1 1244
On Jan 7, 6:42 pm, Michael Chesterton <che...@chesterton.id.auwrote:
I'm trying to get a program that uses M2Crypto ThreadingSSLServer to
run in windows as a service. I have a few problem, it doesn't listen
on its port and I don't know how to debug it.

I used the pipeservice example as a framework to get it running as a
service

def SvcDoRun(self):
# Write an event log record - in debug mode we will also
# see this message printed.
servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE,
servicemanager.PYS_SERVICE_STARTED,
(self._svc_name_, '')
)

daemonserver = do_daemon()
while 1:
daemonserver.handle_request()

I think I need a way to break out of that while loop when a service
stop is sent, but not knowing what happening at that point I'm not
sure how. It's not even listening on its port.

daemonserver is

daemonserver = SSL.ThreadingSSLServer((host_ip_addr, int
(host_port_num)), TestRequestHandler, ctx)

any help?

--
Michael Chestertonhttp://chesterton.id.au/blog/http://barrang.com.au/

--
Michael Chestertonhttp://chesterton.id.au/blog/http://barrang.com.au/
Before you get it going as a service, test it as just a regular Python
script. I've created local servers using CherryPy before and been able
to test them. I recommend you do the same with yours before changing
it to a service.

If you have a firewall installed (which you should), you may need to
allow your program access through it. I've occasionally had to allow
localhost with some of the more stringent firewalls.

I found this post on creating a Windows Service for Windows 2000,
which can probably be modified for XP:
http://agiletesting.blogspot.com/200...s-windows.html

There's also this one: http://essiene.blogspot.com/2005/04/...-services.html

They both sound different from the way you did it, but maybe I
misunderstood.

Mike
Jan 8 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Michael Riggio | last post: by
1 post views Thread by Artur Kowalski | last post: by
9 posts views Thread by SP | last post: by
1 post views Thread by Scott Davies | last post: by
reply views Thread by Scott Davies | last post: by
3 posts views Thread by Doug Bailey | last post: by
4 posts views Thread by tshad | last post: by
5 posts views Thread by dm3281 | last post: by
1 post views Thread by =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post: by
reply views Thread by XIAOLAOHU | 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.