Quantcast
Channel: Gracefully shutdown UNIX-socket server on NodeJS running under Forever - Stack Overflow
Browsing latest articles
Browse All 6 View Live

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 Article



Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Gracefully 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
Browsing latest articles
Browse All 6 View Live




Latest Images