Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

klient/os: add exec/kill methods #10728

Merged
merged 2 commits into from Mar 10, 2017
Merged

klient/os: add exec/kill methods #10728

merged 2 commits into from Mar 10, 2017

Conversation

rjeczalik
Copy link
Member

deps: #10726

This PR adds the following kite methods:

  • os.exec
  • os.kill

The os.exec methods is a reworked version of existing
exec method with a new API that is needed for KD. Since
the exec method is still used on client side, it's being
marked as deprecated and new version rolled out.

The os.kill method addresses shortcoming in current "kd run"
implementation - if user aborts command execution with CTRL+C,
the command won't get killed on a remote machine.

New implementation is going to call machine.kill upon exit,
which effectively will kill the user process on the remote side.

The os.kill method is limited to only those processes that
were started with os.exec.

This PR adds the following kite methods:

  - os.exec
  - os.kill

The os.exec methods is a reworked version of existing
exec method with a new API that is needed for KD. Since
the exec method is still used on client side, it's being
marked as deprecated and new version rolled out.

The os.kill method addresses shortcoming in current "kd run"
implementation - if user aborts command execution with CTRL+C,
the command won't get killed on a remote machine.

New implementation is going to call machine.kill upon exit,
which effectively will kill the user process on the remote side.

The os.kill method is limited to only those processes that
were started with os.exec.

// TestCommandHelper is used by TestExec / TestKill tests to
// execute test code as an external process.
func TestCommandHelper(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rjeczalik rjeczalik merged commit 5930ef1 into master Mar 10, 2017
@rjeczalik
Copy link
Member Author

@cihangir Ptal, I'm going to address your comments if you have any in a separate PR.

@rjeczalik rjeczalik deleted the os-exec-kill branch March 10, 2017 20:15
Copy link
Contributor

@cihangir cihangir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants