windows服务启动超时 [英] windows service startup timeout

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

问题描述

有没有办法为每个服务的服务启动超时设置不同的值?我可以使用 ServicesPipeTimeout 注册表项更改它,但它是针对每台机器的 (http://support.microsoft.com/kb/824344).

Is there a way to set a different value for service startup timeout per service? I can change it using the ServicesPipeTimeout registry key, but it's per machine (http://support.microsoft.com/kb/824344).

目前我唯一想到的就是在不同的线程中完成所有耗时的启动操作.

At the moment the only thing I thought about was to do all the time-consuming startup actions in a different thread.

推荐答案

尽快完成服务的启动是一种很好的做法.因此,在 start 状态期间,只执行您绝对需要确认它已成功启动的操作;剩下的事以后再做.如果开始仍然是一个漫长的过程,请使用SetServiceStatus 定期通知服务控制管理器您尚未完成,因此它不会使您的服务超时.

It's good practice to finish starting your service as fast as possible. So, during the start state, do only what you absolutely need to acknowledge it started successfully; and do the rest later. If the start is still a lengthy process, use SetServiceStatus periodically to inform the Service Control Manager that you have not yet finished, so it does not time-out your service.

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

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