简体   繁体   English

nodejs子进程信号处理

[英]nodejs child process signal handling

I'v got a daemon child process (Linux) spawned from the server via child_process.spawn(...) . 我有一个通过child_process.spawn(...)从服务器生成的守护进程子进程(Linux

I can kill it with p.kill() command and the child process dies fine. 我可以使用p.kill()命令将其杀死,并且子进程可以正常运行。 However, when I send USR signals to the child process - let's say p.kill("SIGUSR1") - prior to killing it p.kill("SIGKILL") the child process gets the USR1 signal, but, surprisingly, the subsequent SIGKILL never gets to the child(!?). 但是,当我向子进程发送USR信号时-假设p.kill(“ SIGUSR1”) -在杀死它之前, p.kill(“ SIGKILL”)子进程会获得USR1信号,但是令人惊讶的是,随后的SIGKILL永远不会碰到孩子(!?)。 Also, exit event of the child process is not called as well. 此外,子进程的退出事件也未调用。

Is there anything I miss about signal handling in node? 关于节点中的信号处理,我有什么想念的吗?

Cheers 干杯

Have just found it :) It's a bug: https://github.com/joyent/node/issues/1035 刚刚发现它:)这是一个错误: https : //github.com/joyent/node/issues/1035

Calling process.kill(pid,signal) works multiple times. 调用process.kill(pid,signal)可以多次工作。

Cheers 干杯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM