Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better interactive command management #21

Merged
merged 1 commit into from
Mar 22, 2017
Merged

Conversation

mitchellwrosen
Copy link
Collaborator

Fixes #20

Now, jobs are run in their own process group, which is sent SIGTERM when the job ends or is terminated. This is a simple effort to kill any non-daemon child processes spawned by the job during its run.

The launched job now needs to be given terminal control so it can read input, which is restored on completion to sos. Also, stdin is flushed before running a job, in case the user happened to type some stuff into the terminal on accident (which is never read by sos).

@mitchellwrosen
Copy link
Collaborator Author

mitchellwrosen commented Mar 22, 2017

As an example motivation for this change, I'm able to now use this .sosrc file when developing a rust project:

- pattern: ^src/.*\.rs$
  commands:
    - cargo build
    - cargo run

which previously would not kill the running binary between file saves (cargo run forks). Yay!

@schell
Copy link
Owner

schell commented Mar 22, 2017

This looks great and I admit this problem has happened to me as well. Looks like the travis.yaml will need an update as well since it's now building with out of date snapshots (I can do this later).

@schell schell merged commit aaa12c9 into schell:master Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants