Answer by Old Pro for Gracefully shutdown UNIX-socket server on NodeJS...
As other people have mentioned, you cannot do anything in response to SIGKILL, which is in general why forever (and everybody else) should not be using SIGKILL except in extreme circumstances. So the...
View ArticleAnswer by amirka for Gracefully shutdown UNIX-socket server on NodeJS running...
you must choose change SIGKILL to another signal in forever-monitor to handle in app take care of your app in this case, using fs.unlink stop using forever
View ArticleAnswer by laktak for Gracefully shutdown UNIX-socket server on NodeJS running...
Since you cannot handle SIGKILL and you want to use forever (which uses SIGKILL) you will have to use a workaround. For example, first send a signal to shutdown your server and then do the forever...
View ArticleAnswer by amirka for Gracefully shutdown UNIX-socket server on NodeJS running...
server.on('error', function (e) { if (e.code == 'EADDRINUSE') { console.log('Address in use, retrying...'); setTimeout(function () { server.close(); server.listen(PORT, HOST); }, 1000); } });...
View ArticleAnswer by Clintm for Gracefully shutdown UNIX-socket server on NodeJS running...
you should be able to use SIGTERM to do what you want: process.on('SIGTERM', shutdown)
View ArticleGracefully shutdown UNIX-socket server on NodeJS running under Forever
I have an NodeJS application which sets up a UNIX-socket to expose some interprocess communication channel (some kind of monitoring stuff). UNIX-socket file is placed in os.tmpdir() folder (i.e....
View Article
More Pages to Explore .....