[python-win32] Windows service features and Python

Imre András Róbert beast at ludens.elte.hu
Thu Aug 5 21:48:06 CEST 2004


Hello list,

I'm transforming some Python code into a Windows
service. I started with pywin32-202.win32-py2.2.exe,
and investigated the demo pipeTestService. This
worked fine, so I started converting my code, with
no paticular Windows system programming experience.

After reading through the help, the newsgroups and
searching on the web, I still have the following questions:

Q1) How can I make my Python service support pause/
    continue? Implementing SvcPause() and SvcContinue()
    seems to be not enough, as I get 'Could not pause
    ... service on Local Computer. The service did not
    return an error. ...' dialog despite that the
    SvcPause() method is executed. After this dialog
    I found that the service was stopped, ending within
    SvcDoRun(). Please refer to the attached code.

Q2) How can I register my own event IDs/categories? I don't
    know where/how to define my own IDs/cats. The demo seems
    to support two IDs, servicemanager.PYS_SERVICE_STARTED and
    servicemanager.PYS_SERVICE_STOPPED.

Q3) How can I add counters to the Python service? Looking at
    the files perf_install.ini and perf_install.h, this
    could be possible, but after install I do not see these
    counters in PerfMon. I do not see the way these files
    are connected to the service demo source code... Maybe
    these are already installed as the readme indicates,
    but where should I look?

After all the package is quite useful with the start/stop
service feature itself, but I would welcome some fancy stuff
as well...
    
-- 
Thanks,
  András



More information about the Python-win32 mailing list