Open vid opened 9 years ago
just want to kill the child_process. Don't know much about nodejs signals here, any better suggestion here?
You should be able to use a milder signal like SIGHUP.
@vid I had error with SIGHUP, I'm running node v0.10.36 on win7. As far as I know, I need to kill this child_process, and SIGKILL works for me.
What do you mean by "close database connections before restarting", what API do you want? A callback for server.stop
?
Have you tried SIGINT, per the process page above? If necessary you could detect the OS if you'd like your module to be cross platform.
I mean my app opens a connection to the database and should properly close it before restarting, as would any well behaved app.
No dice with SIGINT. I'm searching for a way to kill
the child process while being able to catch it in the script(app.js), so that we can do some cleanup in app.js before it was killed.
+1, I'm building a workflow with a watcher on js files and it would be nice if the script does not exit when there is an error in the child process
please use https://github.com/gimm/gulp-live-server instead of gulp-express, I'll apply your change to gulp-live-server soon
Thanks :)
It's not trappable. I would like to close database connections before restarting.
http://nodejs.org/api/process.html#process_signal_events
thanks!