Skip to content

Allow Breakaway OK on SSH Job #1032

Closed
Closed
@jborean93

Description

@jborean93

"OpenSSH for Windows" version
1.0.0.0

Server OperatingSystem
Windows Server 2016 Standard Evaluation
Still applies to all other hosts as well

Client OperatingSystem
N/A (tested on MacOS though)

What is failing
The ssh-shellhost.exe process that is spawned on an SSH connection does not allow processes to breakaway from the job. This means any process it spawns won't be able to breakaway from the SSH job. This is useful if you want to run a process while not keeping the SSH connection open.

As you can see by Process Explorer, the only limit placed on the Job is Kill on Job Close

image

Compared to a process that is spawned by WinRM, it contains some more job limits that are mostly configurable by the service. The key one I am looking for is Breakaway OK which allows the process to call the CreateProcess (and derivative) the CREATE_BREAKAWAY_FROM_JOB creation flag https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx. You can see this based on the cmd.exe process that I spawned on a WinRM process

image

I'm not sure if this is intentional on your part but it would be good to hear your thoughts on this as this is a key feature Ansible uses to achieve async support on the current WinRM connection. If we were to loose this feature, our options are limited and we may need to resort to scheduled tasks which aren't really that easy to manage.

On a side note this is not a "regression" of the 1.0.0.0 release as this has been the case for the past few releases.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions