“自动"vs “自动(延迟启动)" [英] "Automatic" vs "Automatic (Delayed start)"

查看:114
本文介绍了“自动"vs “自动(延迟启动)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装 Windows 服务时,有两个选项可用于在 Windows 启动时自动启动 Windows 服务.一种是自动,另一种是自动(延迟启动).这两者在细节上有什么区别?

When installing Windows services there are two options for automatically starting a Windows service on Windows startup. One is Automatic, and the other is Automatic (Delayed start). What is the difference between these two in detail?

例如,如果您使用 wixtoolset 创建安装程序,ServiceConfig 元素具有 DelayedAutoStart 属性.这将如何影响在启动时启动服务时发生的情况?

For example, if you're creating the installer with wixtoolset, the ServiceConfig element has the DelayedAutoStart attribute. How will that effect what happens when services are started at boot time?

WiX 文档:ServiceConfig 元素

WiX documentation: ServiceConfig Element

推荐答案

简而言之,设置为 Automatic 的服务将在启动过程中启动,而设置为 Delayed 的服务启动em> 将在启动后不久启动.

In short, services set to Automatic will start during the boot process, while services set to start as Delayed will start shortly after boot.

启动您的服务延迟可提高服务器的启动性能,并具有在文章 阿德里亚诺链接在评论中.

Starting your service Delayed improves the boot performance of your server and has security benefits which are outlined in the article Adriano linked to in the comments.

更新:启动后不久"实际上是最后一个自动"服务启动后的 2 分钟,默认情况下.这可以通过注册表项进行配置,根据 Windows Internals和其他来源(34).

Update: "shortly after boot" is actually 2 minutes after the last "automatic" service has started, by default. This can be configured by a registry key, according to Windows Internals and other sources (3,4).

感兴趣的注册表项(至少在某些 Windows 版本中)是:

The registry keys of interest (At least in some versions of windows) are:

  • HKLM\SYSTEM\CurrentControlSet\services\\DelayedAutostart 如果延迟,则值为 1,否则为 0.
  • HKLM\SYSTEM\CurrentControlSet\services\AutoStartDelayHKLM\SYSTEM\CurrentControlSet\Control\AutoStartDelay(在 Windows 10 上):等待的十进制秒数,可能需要创建这个.全局适用于所有延迟服务.
  • HKLM\SYSTEM\CurrentControlSet\services\<service name>\DelayedAutostart will have the value 1 if delayed, 0 if not.
  • HKLM\SYSTEM\CurrentControlSet\services\AutoStartDelay or HKLM\SYSTEM\CurrentControlSet\Control\AutoStartDelay (on Windows 10): decimal number of seconds to wait, may need to create this one. Applies globally to all Delayed services.

这篇关于“自动"vs “自动(延迟启动)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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