windows - 错误 1053 : the service did not respond to the start or control request in a timely fashion

标签 windows error-handling windows-services timeout

我最近继承了几个作为 Windows 服务运行的应用程序,但我在为它们提供 gui(可从系统托盘中的上下文菜单访问)时遇到问题。

我们需要 windows 服务的 gui 的原因是为了能够重新配置 windows 服务的行为,而无需停止/重新启动。

我的代码在 Debug模式下运行良好,我得到了上下文菜单,一切都正常运行等等。

当我使用指定帐户(即非本地系统帐户)通过“installutil”安装服务时,服务运行良好,但不在系统托盘中显示图标(我知道这是正常行为,因为我没有“与桌面交互”选项。

但问题是 - 当我选择“LocalSystemAccount”选项并选中“与桌面交互”选项时,该服务无缘无故地启动了 AGES,而且我一直在获取

Could not start the ... service on Local Computer.

Error 1053: the service did not respond to the start or control request in a timely fashion.

顺便说一句,我通过注册表 hack 将 Windows 服务超时从默认的 30 秒增加到 2 分钟(参见 http://support.microsoft.com/kb/824344,在第 3 节中搜索 TimeoutPeriod),但是服务启动仍然超时。

我的第一个问题是 - 为什么“本地系统帐户”登录比使用非 LocalSystemAccount 服务登录时花费的时间长得多,导致 Windows 服务超时?这两者之间有什么区别会导致启动时出现这种不同的行为?

其次 - 退后一步,我想要实现的只是一个为配置提供 gui 的 Windows 服务 - 我很乐意使用非本地系统帐户(指定用户/pwd),如果我可以获得与桌面交互的服务(即,系统托盘中有一个可用的上下文菜单)。这可能吗?如果可能的话如何?

如有任何关于上述问题的建议,我们将不胜感激!

最佳答案

在与这条消息抗争了好几天之后,一位 friend 告诉我您必须使用 Release 版本。当我 InstallUtil 调试构建时,它会给出此消息。发布版本开始正常。

关于windows - 错误 1053 : the service did not respond to the start or control request in a timely fashion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/158371/

相关文章:

windows - Linux 自旋锁与 NT KeAcquireSpinLock

Windows 批处理脚本 - For/L 不起作用 - 简单

windows - 'ssh-keygen' 未被识别为内部或外部命令

vb.net - 将文本写入VB中的文件时出现格式异常错误

windows - 向除 Microsoft Windows 2012 Server 上的一个用户之外的所有用户发送消息

delphi - MadExcept异常过滤器

c# - 为什么我得到这个 NullReferenceException C#

java - 从 Java 应用程序查找 Windows 服务的状态?

c# - MSI 卸载问题 : Error 1001 -> The saved State dictionary contains inconsistent data and might have been corrupted

java - 与 Procrun 一起安装的 Windows 服务在//TS 模式下工作,但不会作为 Windows 服务启动,提示它 "started and then stopped"