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

Configurable SIGTERM instead of SIGKILL #101

Closed
plievone opened this issue Apr 24, 2017 · 5 comments
Closed

Configurable SIGTERM instead of SIGKILL #101

plievone opened this issue Apr 24, 2017 · 5 comments
Assignees

Comments

@plievone
Copy link

Hi, debug adapter uses SIGKILL (-9) to terminate child processes in Linux and MacOS:

Could it be made configurable, so that one could use SIGTERM if one has some quick cleanup tasks in the process to be debugged? Currently they cannot run, as SIGKILL cannot be listened to. In the meantime, one can workaround this somewhat by using nodemon or such.

In case child processes won't exit when such non-default signals are used and there are leftover processes, they could be killed manually. Or perhaps one could implement treekill in cross platform way similar to https://github.com/indexzero/ps-tree .

@weinand
Copy link
Contributor

weinand commented Apr 24, 2017

The corresponding issue for node-debug is this microsoft/vscode-node-debug#1

(node-debug's very first issue!)

@weinand
Copy link
Contributor

weinand commented Apr 24, 2017

@plievone @roblourens
my proposal would be to use SIGTERM for the existing "Terminate" action and SIGKILL for a new "kill" action. A shortcut could be to use a modifier key when pressing the "Terminate" button.

Opinions?

@plievone
Copy link
Author

@weinand That would be perfect, but would it mean that the "Terminate" action would need to check if the processes exited properly, so that the same debug toolbar can be used for "Kill" in case it is needed (instead of the toolbar hiding automatically)? Or is that a rare situation?

Also "Restart" action would need to use sigterm, that is the important one.

@auchenberg auchenberg modified the milestone: June 2017 Jun 6, 2017
@roblourens roblourens removed this from the June 2017 milestone Jun 28, 2017
@samir-mahendra
Copy link

@weinand May I propose that you make the Terminate action a Launch Configuration attribute?

It could be called "stopSignal" or "terminateSignal", and default to "SIGKILL" if not specified (to maintain current functionality).

Then users could override it in their Launch Configuration. E.g., to send a "SIGINT" instead of "SIGKILL", they could update their launch configuration to:

// Proposed changed to launch.json
{
   "name": "Start",
   "type": "node",
   "request": "launch",
   "program": "${workspaceRoot}/start.js",
   "terminateSignal": "SIGINT" // <-- Proposed new configuration parameter.
}

@roblourens
Copy link
Member

This is implemented now

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants