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

Can't send signals using signal numbers #18553

Closed
hinzundcode opened this issue Feb 4, 2018 · 4 comments
Closed

Can't send signals using signal numbers #18553

hinzundcode opened this issue Feb 4, 2018 · 4 comments
Labels
doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem.

Comments

@hinzundcode
Copy link

Using process.kill with signal numbers should work according to the documentation, but I get an ERR_UNKNOWN_SIGNAL error when using numbers instead of strings. For example:

$ node
> process.kill(process.pid, "SIGTERM")
Terminated

$ node
> 15 === require("constants").SIGTERM
true
> process.kill(process.pid, 15)
TypeError [ERR_UNKNOWN_SIGNAL]: Unknown signal: 15
    at process.kill (internal/process.js:168:15)
@ChALkeR ChALkeR added process Issues and PRs related to the process subsystem. doc Issues and PRs related to the documentations. labels Feb 4, 2018
@ChALkeR
Copy link
Member

ChALkeR commented Feb 4, 2018

Looks like a doc issue (ambiguity). Supported are signal names

Signal names are strings such as 'SIGINT' or 'SIGHUP'. See Signal Events and kill(2) for more information.

and 0:

As a special case, a signal of 0 can be used to test for the existence of a process.

Or is this a featue request to support signal numbers there?

@hinzundcode
Copy link
Author

Oh, you are right. I didn't read the documentation carefully enough. Sorry :/

@bnoordhuis
Copy link
Member

There's an open pull request for it, #16944, but it's blocked on failing tests.

@plroebuck
Copy link

PR merged in Node-9.6.0 [2018-02-21].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants