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

Waiting for a process spawned by dcli exec #263

Closed
Mikescops opened this issue Jun 11, 2024 Discussed in #262 · 0 comments · Fixed by #264
Closed

Waiting for a process spawned by dcli exec #263

Mikescops opened this issue Jun 11, 2024 Discussed in #262 · 0 comments · Fixed by #264
Assignees
Labels
bug Something isn't working

Comments

@Mikescops
Copy link
Member

Mikescops commented Jun 11, 2024

Discussed in #262

Originally posted by sbaldrich June 10, 2024

Given this script.sh file:

sleep 100

Why does dcli exec -- ./script.sh not block until sleep finishes? I'm not actually intending to use sleep in my script but this reflects the problem I'm facing (I'm actually calling an interactive process)

I initially thought that it had to do with spawn not blocking but I've failed to reproduce it using a minimal example (execution waits until sleep returns):

// app.js , run it using 'node app.js'
const spawn = require('child_process').spawn

const child = spawn('sleep',['10'], {
    stdio: 'inherit',
    shell: true
})

child.on('exit', c => console.log(c))
```</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant