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

Have to press CTRL+C twice to kill a script that exec sudo command #46351

Closed
nodated opened this issue Jan 25, 2023 · 2 comments
Closed

Have to press CTRL+C twice to kill a script that exec sudo command #46351

nodated opened this issue Jan 25, 2023 · 2 comments

Comments

@nodated
Copy link

nodated commented Jan 25, 2023

Version

18.13.0

Platform

64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023

Subsystem

child_process

What steps will reproduce the bug?

  • I follow this guide to configure sudo to never ask for password
  • Then create an index.js:
import {exec} from "child_process";
const child1 = exec(`sudo sleep 60`);
const child2 = exec(`sleep 60`);
  • Run node index.js from terminal
  • Wait 3 seconds
  • Press Ctrl+C

How often does it reproduce? Is there a required condition?

The problem only happens in Ubuntu 22.04. Works fine in Ubuntu 20.04

What is the expected behavior?

The first time press Ctrl+C the parent process should be killed

What do you see instead?

Have to press CTRL+C twice to kill the parent process

Additional information

No response

@bnoordhuis
Copy link
Member

The problem only happens in Ubuntu 22.04. Works fine in Ubuntu 20.04

That suggest it's an issue with ubuntu, not node, right?

@bnoordhuis
Copy link
Member

No follow-up, closing.

@bnoordhuis bnoordhuis closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2023
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

No branches or pull requests

2 participants