I am catching SIGINT
signal to gracefully shutdown app. I am use child process which I would like to keep till I complete shutdown (by default child process have same process group and it recievs signal same time). I use spawn to start child process and try to use it with gid
option.
var child = spawn(pathToFFMPEG,[
'-t', duration,
'-i', station.streamEndpoint,
'-f', 'mp3',
'pipe:1'
],{
gid: Math.ceil(Math.random()*100000)
})
I got ENOTSUP
error when I try to start child process (without gid
option process starts normally).
How to correct set up process group for child process using spawn? In my example I generate gid
randomly but it seems it's not good idea even without above error.
I read this article before my experiment with gid
. Thanks.
Edit
It seems gid
is not supported (at least directly setting it). Are there any options to avoid closing child process with SIGINT
signal?