Windows 服务已启动,但进程被终止
我正在 Windows 2000 计算机上运行 Windows 服务。有时,该服务的可执行文件会终止,但 Windows 服务仍然在服务管理器中列为“已启动”。在这种情况下,为此服务定义的重新启动行为不会生效。
我怎样才能避免这种情况呢?这是Windows 2000的配置问题还是Windows服务配置错误?
编辑:Windows服务是使用py2exe在Python中自行编写的,基于以下描述:创建一个python win32服务
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 service 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Windows 服务恢复机制仅在认为服务失败时才会启动。当它认为服务已经正常结束时,不会被触发。
来自 Microsoft 的文档 (http://msdn.microsoft .com/en-us/library/ms685939%28v=VS.85%29.aspx):
我的猜测是,您的 Python 程序要么是:
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):
My guess is that your Python program is either: