Skip to content

Commit 5c9d2bf

Browse files
committed
windows configurer: use shutdown /r /f /t 0 to force-close applications
The /f flag forces running applications to close, which is necessary on Windows Server 2025 where processes can block a pending reboot. Without it, 'shutdown /r /t 0' completes but the host never actually reboots.
1 parent 66dd9ef commit 5c9d2bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/configurer/windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func isExitCode3010(err error) bool {
137137
//
138138
// TODO: move this fix upstream into the k0sproject/rig Windows configurer.
139139
func (c WindowsConfigurer) Reboot(h os.Host) error {
140-
if err := h.Exec("shutdown /r /t 0"); err != nil {
140+
if err := h.Exec("shutdown /r /f /t 0"); err != nil {
141141
// The OS may kill the WinRM session before the command returns;
142142
// treat connection-level errors as success since the reboot is underway.
143143
errMsg := err.Error()

0 commit comments

Comments
 (0)