Windows 服务恢复未重新启动服务 [英] Windows Services Recovery not restarting service

查看:78
本文介绍了Windows 服务恢复未重新启动服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Windows 服务的恢复配置为在失败后延迟一分钟重新启动.但我从来没有真正重启过服务(即使是最明显的错误).

我确实在 EventViewer 中收到一条消息:

<块引用>

找不到源 (MyApp.exe) 中事件 ID (1) 的描述.本地计算机可能没有必要的注册表信息或消息 DLL 文件来显示来自远程计算机的消息.您可以使用/AUXSOURCE= 标志来检索此描述;有关详细信息,请参阅帮助和支持.以下信息是事件的一部分: 模块MyApp.exe"中地址 00429874 处的访问冲突.写入地址 00456704.

还有什么我需要做的吗?我的代码(我使用 Delphi)中是否有需要设置才能启用此功能的内容?

解决方案

Service Recovery 旨在处理服务崩溃的情况 - 因此,如果您转到 taskmgr 并右键单击服务进程上的结束进程",则恢复逻辑应该启动.如果您的服务正常退出(即使退出时出现错误),我认为服务恢复逻辑不会启动.

还有 eventvwr 消息表明您的应用程序调用了 ReportEvent API,指定了事件 ID 1.但是您还没有使用事件查看器注册事件消息,因此它无法将事件 ID 1 转换为有意义的文本字符串.

I configure the recovery for Windows services to restart with a one minute delay after failures. But I have never gotten it to actually restart the service (even with the most blatant errors).

I do get a message in the EventViewer:

The description for Event ID ( 1 ) in Source ( MyApp.exe ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Access violation at address 00429874 in module 'MyApp.exe'. Write of address 00456704.

Is there something else I have to do? Is there something in my code (I use Delphi) which needs to be set to enable this?

解决方案

Service Recovery is intended to handle the case where a service crashes - so if you go to taskmgr and right click "end process" on your service process, the recovery logic should kick in. I don't believe that the service recovery logic kicks in if your service exits gracefully (even if it exits with an error).

Also the eventvwr message indicates that your application called the ReportEvent API specifying event ID 1. But you haven't registered your event messages with the event viewer so it can't convert event ID 1 into a meaningful text string.

这篇关于Windows 服务恢复未重新启动服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆