making a Windows NT service out of a python program

Andrew Cooke andrew at andrewcooke.free-online.co.uk
Tue Jul 13 12:18:59 EDT 1999


In article <378B2C50.B7C2134A at cern.ch>,
  "Haimo G. Zobernig" <Haimo.Zobernig at cern.ch> wrote:
> I'm in exactly the same situation - no idea what really distinguishes
a
> "service"
> from any old program, or how programs behave differently when run as a
service.
> Anyway, thanks for Bill's pointer, I will be trying out the
pipeTestService.py
> example and see if I can adapt that for my purpose.

Services are described quite well in the help files that come with
VC/Developer Studio, if you're lucky enough to have that ;-)

They are useful because you can specify an account for them to run in
(assuming you have sufficient priveliges), set whether they should be
started automatically, and let them access the user's screen.

At base, they are just ordinary programs, but they have to meet a
particular interface so that they can be controlled (ie provide methods
to stop, start, pause them etc.)  Writing programs to install/start
services is more complicated, but hopefully you won't need to do that
(the Control panel can stop and start them, and I assume the Python
package others mentioned has an installer).  If you poke around in the
registry you'll find entries that associate services with particular
programs etc.

The worst thing about them is that they can be tricky to debug.  If they
are running in the system account then they have a restricted
environment and the standard output channels send useful data to
somewhere I never found.  So the first thing you want to do is open a
file somewhere for debug information...

All this is from C and Java knowledge, I've never written a Python
service, so I can't give more specific help.

Good luck,
Andrew




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




More information about the Python-list mailing list