Knife winrm keeps going after chef-client run?


Just posting here to see if anyone else has suffered from this.

I’m using knife winrm to run a few powershell commands along with a chef-client run (all in local mode). Everything works as expected until the very end where after chef-client completes the command just keeps going indefinitely.

I also noticed that when we cancel out of any knife winrm processes that they appear to keep running on the Windows box, which may be a factor.

Has anyone got knife winrm working well with chef-client runs? Specifically in a CI pipeline?




Just to tie this off, turns out all is well and the session was being kept alive as I was starting a Java Appserver. Turns out on windows if you start a thing like this in the session it’ll stay alive as long as the appserver is running.

Solution was to start the appserver as part of a scheduled task.