开发者

Windows Service started, but process killed

I am running a Windows Service on a Windows 2000 machine. Sometimes the executable for this service dies, but the Windows service is still listed as "started" in the service manager. In this situation the restart behaviour defined for this ser开发者_Go百科vice does not take effect.

How can I avoid this situation? Is this a configuration problem of Windows 2000 or is the Windows service wrongly configured?

EDIT: The windows service is self-written in Python using py2exe, based on this description: Creating a python win32 service


The Windows Service Recovery mechanism will only kick in when it thinks the service has failed. It will NOT be triggered when it thinks the service has ended normally.

From Microsoft's documentation (http://msdn.microsoft.com/en-us/library/ms685939%28v=VS.85%29.aspx):

A service is considered failed when it terminates without reporting a status of SERVICE_STOPPED to the service controller.

My guess is that your Python program is either:

  1. Catching the crash, cleaning up and exiting normally, or
  2. Hung. Can you confirm that you don't see the exe in the Task Manager when this happens? (Be sure to show processes from all users...)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜