AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-53717

Skrymsli's questions

Martin Hope
Skrymsli
Asked: 2020-03-27 14:37:27 +0800 CST

从 Windows 服务的上下文中,我如何确定 Windows 更新当前是否正在运行?

  • 1

我有一项服务在启动时进行了一些系统配置,但遇到了一个问题,即 Windows 更新同时运行并启动了重新启动,这中断了我的服务正在执行的操作,并且我的配置被破坏了。我想将服务启动延迟到 Windows 更新完成并完成任何重新启动之后。有没有办法告诉更新当前正在运行?然后我可以让我的服务等待并在下次启动或更新完成时恢复。将我的服务标记为自动(延迟启动)是否有帮助?

编辑:我严格控制是否启用/禁用 Windows 更新服务,作为配置的一部分,我手动启用服务并安装特定更新。通常这会导致错误代码 3010,这意味着需要重新启动机器并完成更新。因此,在重新启动后,我会从我的服务中继续进行进一步的配置更新。

经过进一步调查,这是由于 Windows 更新启动失败而发生的。我在 CBS 日志中看到了这一点:

2020-03-26 21:05:54, Info                  CBS    Startup: Failed, restart required to try again.
2020-03-26 21:05:54, Info                  CBS    Startup: Processing complete. [HRESULT = 0x80070bc2 - ERROR_SUCCESS_REBOOT_REQUIRED]
2020-03-26 21:05:54, Info                  CBS    Keeping Trusted Installer as auto-start
2020-03-26 21:05:54, Info                  CBS    Winlogon: Checking to see if CreateSessionNotify has been called at least once.
2020-03-26 21:05:54, Info                  CBS    Winlogon: CreateSessionNotify has been called
2020-03-26 21:05:54, Info                  CBS    Winlogon: Simplifying Winlogon CreateSession notifications
2020-03-26 21:05:54, Info                  CBS    Startup: received notification that startup processing completed and a restart has been initiated.
2020-03-26 21:05:54, Info                  CBS    A restart has been initiated

之后我的服务重新启动了机器并恢复了其配置,但 Windows 更新随后同时运行并重新启动了我。在另一台机器上这没有发生,我在 CBS 日志中有这些消息:

2020-03-26 21:01:50, Info                  CBS    Startup: Retrying failed packages.
2020-03-26 21:01:50, Info                  CBS    Startup: Processing complete. [HRESULT = 0x00000000 - S_OK]
2020-03-26 21:01:50, Info                  CBS    Enabling LKG boot option
2020-03-26 21:01:50, Info                  CBS    Setting ServicingInProgress flag to 0
2020-03-26 21:01:50, Info                  CBS    Startup processing completed. [HRESULT = 0x00000000]
2020-03-26 21:01:50, Info                  CBS    Winlogon: Simplifying Winlogon CreateSession notifications
2020-03-26 21:01:50, Info                  CBS    Winlogon: Deregistering for CreateSession notifications
2020-03-26 21:01:50, Info                  CBS    Startup: received notification that startup processing completed, allowing user to logon
2020-03-26 21:01:50, Info                  CBS    Startup processing complete, Trusted Installer will now wait around for a little while to see if any clients show up.

我不确定如何区分这两种情况,Windows Update 已完成并需要重新启动,以及它本质上将重新启动并重试,而不是解析此日志。我正在寻找某种状态或状态来指示 Windows 更新正在做什么。

windows windows-service windows-update windows-server-2016
  • 3 个回答
  • 1170 Views
Martin Hope
Skrymsli
Asked: 2016-12-01 08:51:45 +0800 CST

WIndows 2016:恢复到快照后如何强制时间同步?

  • 4

将 vmware vsphere server 6.0.0 与运行 Windows 2016 的 VM 一起使用。我已将 Windows 设置为与 time.nist.gov 同步时间。机器使用 UTC 时区。恢复到快照后,时间有一段时间不会更新(如果有的话?)。我尝试了各种 w32tm.exe 命令来尝试强制重新同步,但它说时间差太大(通常会关闭几天或几周)。

我能够立即更新的唯一方法是进入此对话框并更改时间服务器,然后单击立即更新。然后改回来:

在此处输入图像描述

在相同设置中的 Windows 2012 不会发生这种情况。我希望在恢复快照后时间会立即同步。也许 Windows 2016 中发生了一些变化,我需要在拍摄快照之前或还原之后做一些不同的事情?或者可能需要在 vsphere 中进行不同的配置?

ntp vmware-vsphere windows-server-2016
  • 2 个回答
  • 5599 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve