Resources in these threads:
Thread 1: https://www.nodeloc.com/t/topic/117482
Thread 2: https://www.nodeloc.com/t/topic/117536
This post is mainly about analyzing this cloud PC's auto-shutdown policy.
What happens: If you deploy some agent or automation tool on it, you'll notice that after a while all the processes on the machine get killed; and if there's no remote desktop connection, the machine goes to sleep.
I had Opencode analyze it, and here's the result:
Investigation summary
Core conclusion
There are no PowerShell scheduled tasks, services, or automation scripts on this machine that "periodically close all programs or reset." The decision to repeatedly shut down is made on the remote cloud platform, and the action is executed by the local cloud desktop agent (clink).
Scope and results (all negative)
Check Result All scheduled tasks ( schtasks /fo csv /v)Only 2 invoke PowerShell: TeleAgentWatchdog(keeps TeleAgent alive) andWinVMDataDiskAutoInitialize(Azure disk initialization), both harmlessServices No services with PowerShell/scripts as their entry point Run / RunOnce registry Only SecurityHealth,AzureArcSetup,TeleAgentStartup folder Empty Scheduled task XML No Hidden=true, no shutdown/taskkillWMI permanent event subscriptions Only the default SCM log consumers Group Policy startup/shutdown scripts Registry path does not exist IFEO Debugger, Winlogon Shell/Userinit All original Full-disk script keyword scan Only ctyun\clink\...\kill-cloudupdatejar.bat(used by cloud update itself)The real trigger
Evidence chain for the Tianyi Cloud Desktop client (clink):
- Smoking gun in the registry
HKLM\SOFTWARE\ecloudsoft\Mirror\ClinkAgent:
SessionEndTime = 1794500599→ converted to 2026-11-13 00:23:19- Actual shutdown event: 00:23:20 — only 1 second off
SessionEndManual = 0,desktopOid = D0026110624642120- Policy pushed by the platform
meta_data:reboot_wait=300,stop_wait=50- Session duration pattern (extracted from clink_service.log): during 11/12–11/13, 8 sessions lasted 30.4 / 30.5 / 30.7 / 30.4 / 30.5 / 30.4 / 30.4 / 30.2 minutes, highly consistent → session quota expiry reclamation allocated by the platform
- Executing components:
clink_service(LocalSystem service, containsGetShutdownFlag,Global\CtyunShutdownMappingObject),ctyunshutdownplug64.dll(exportsMyExitWindowsEx, PDB isShutdownDetect),RebootConfirm.exe(contains API path/api/cdserv/desktop/rebootDesktopand management-side key)- Log confirmation: in
clink_service.log, the line right before each shutdown isSession change to 1 LOGOFF, followed byShutdown clink_serviceFull chain:
Cloud platform management side → pushes SessionEndTime → clink_agent (WebSocket long connection 100.64.3.249:27149) writes to registry → clink_service (LocalSystem) detects session expiry → winlogon.exe calls ExitWindowsEx → power offIn the event log, the 1074 record's initiator is
winlogon.exe/NT AUTHORITY\SYSTEM(notshutdown.exe), which is exactly the typical signature of a service calling ExitWindowsEx in the SYSTEM context, ruling out local scripts and manual shutdown.Can it be refused?
You can't directly refuse it locally, but there are three actionable paths:
- No solution at the Windows level:
ExitWindowsExis a kernel API,SeShutdownPrivilegeis granted by default, admins can also call it directly, and the system does not provide a "deny shutdown" policy.- SessionEndTime is ineffective: it is re-pushed and overwritten by the platform on every boot, and local registry changes get reset immediately.
- Feasible local hard blocks (with trade-offs):
- Disable
clink_service— this will also cut off your remote desktop connection- Remove
ctyunshutdownplug64.dll— requires admin rights, and cloud update will restore it; it's recommended to also disableCloudUpdate- Turn off
AutoEndTasksand increaseWaitToKillAppTimeout— this only gives you more time to save before shutdown, it cannot prevent shutdown (the platform currently pushes a "fast shutdown config":AutoEndTasks=1+WaitToKillAppTimeout=5000, which is exactly why tasks get killed "quickly" and don't have time to save)Recommendation
Don't fight it locally; solve it from the platform side. Submit
desktopOid = D0026110624642120andtenant_oid = Ctyun37d5c336487645511792477754to the cloud platform admin and ask them to check:
- This desktop's session expiry reclamation policy (extend
SessionEndTimeor disable auto-reclamation)- Operation audit logs for who called
rebootDesktopand when- Whether your session duration can be extended or "fast shutdown" can be disabled
At the same time, to reduce actual losses, it's recommended to configure auto-resume after boot for critical long-running tasks (refer to the existing
TeleAgentWatchdogRestartCountapproach), or move time-consuming tasks to an independent background container on the cloud platform so they don't depend on the interactive desktop session staying alive.If needed, I can continue helping you: check which critical processes/tasks are currently running, assess the specific impact of disabling
clink_serviceon your remote connection, or configure auto-resume after restart for a specified task.
资源见贴:
贴1:https://www.nodeloc.com/t/topic/117482
贴2:https://www.nodeloc.com/t/topic/117536
本贴主要分析这个云电脑的自动关机策略。
现象: 如果你在上面部署了某个Agent或者自动化工具,你会发现过一段时间这个电脑的进程就全被干掉了;如果没有连接远程桌面,那么这个机器会休眠。
我让Opencode分析了一下,结果如下:
排查总结
核心结论
本机不存在任何"定时关闭所有程序或重置"的 PowerShell 计划任务、服务或自动脚本。 反复关机的决策权在远端云平台,执行动作由本机的云桌面代理(clink)完成。
排查范围与结果(全部为阴性)
检查项 结果 计划任务全量( schtasks /fo csv /v)仅 2 个调用 PowerShell: TeleAgentWatchdog(保活 TeleAgent)、WinVMDataDiskAutoInitialize(Azure 磁盘初始化),均无害服务 无以 PowerShell/脚本为入口的服务 Run / RunOnce 注册表 仅 SecurityHealth、AzureArcSetup、TeleAgent启动文件夹 空 计划任务 XML 无 Hidden=true,无 shutdown/taskkillWMI 永久事件订阅 仅默认 SCM 日志消费者 组策略启动/关机脚本 注册表路径不存在 IFEO Debugger、Winlogon Shell/Userinit 均为原版 全盘脚本关键字扫描 仅 ctyun\clink\...\kill-cloudupdatejar.bat(云更新自用)真正的触发源
天翼云桌面客户端(clink) 的证据链:
- 注册表铁证
HKLM\SOFTWARE\ecloudsoft\Mirror\ClinkAgent:
SessionEndTime = 1794500599→ 换算为 2026-11-13 00:23:19- 实际关机事件:00:23:20 —— 误差仅 1 秒
SessionEndManual = 0,desktopOid = D0026110624642120- 平台下发策略
meta_data:reboot_wait=300、stop_wait=50- 会话时长规律(从 clink_service.log 提取):11/12–11/13 期间 8 个会话时长为 30.4 / 30.5 / 30.7 / 30.4 / 30.5 / 30.4 / 30.4 / 30.2 分钟,高度一致 → 平台分配的会话配额到期回收
- 执行组件:
clink_service(LocalSystem 服务,含GetShutdownFlag、Global\CtyunShutdownMappingObject)、ctyunshutdownplug64.dll(导出MyExitWindowsEx,PDB 为ShutdownDetect)、RebootConfirm.exe(含 API 路径/api/cdserv/desktop/rebootDesktop与管理端密钥)- 日志印证:
clink_service.log中每次关机前一条即Session change to 1 LOGOFF,随后Shutdown clink_service完整链路:
云平台管理端 → 下发 SessionEndTime → clink_agent (WebSocket 长连 100.64.3.249:27149) 写入注册表 → clink_service (LocalSystem) 检测到会话到期 → winlogon.exe 调用 ExitWindowsEx → 关闭电源事件日志中 1074 记录发起者为
winlogon.exe/NT AUTHORITY\SYSTEM(而非shutdown.exe),正是服务在 SYSTEM 上下文调用 ExitWindowsEx 的典型特征,排除了本地脚本与手动关机。能否拒绝?
不能从本地正面拒绝,但有三条可操作路径:
- Windows 层面无解:
ExitWindowsEx是内核 API,SeShutdownPrivilege默认具备,管理员亦可直调,系统不提供"拒绝关机"策略。- SessionEndTime 无效:每次开机由平台重新下发覆盖,本地改注册表会被立即重置。
- 可行的本地硬拦(有代价):
- 停用
clink_service—— 会同时断掉你的远程桌面连接- 移除
ctyunshutdownplug64.dll—— 需管理员权限,且会被云更新还原,建议同时禁用CloudUpdate- 关闭
AutoEndTasks、调大WaitToKillAppTimeout—— 只能让关机前多留保存时间,不能阻止关机(当前平台下发的是"快速关机配置":AutoEndTasks=1+WaitToKillAppTimeout=5000,这正是任务被"快速"杀掉、来不及保存的原因)建议
不要在本机硬扛,应从平台侧解决。 将
desktopOid = D0026110624642120、tenant_oid = Ctyun37d5c336487645511792477754提交给云平台管理员,请其核查:
- 该桌面的会话到期回收策略(把
SessionEndTime后延或关闭自动回收)- 操作审计日志中谁在何时调用了
rebootDesktop- 是否可为你延长会话时长或关闭"快速关机"
同时,为降低实际损失,建议对关键长任务配置开机自动续跑(参考现有
TeleAgentWatchdog的RestartCount方案),或把耗时任务迁到云平台独立后台容器运行,不依赖交互式桌面会话的存活。如需,我可以继续帮你:核查当前有哪些关键进程/任务在跑、评估停用
clink_service对你远程连接的具体影响,或为指定任务配置重启后自动续跑。
Translated by AI from 简体中文Original (简体中文)
21 replies
Sort order