Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do you use SIGKILL? #34

Open
vid opened this issue Mar 3, 2015 · 8 comments
Open

Why do you use SIGKILL? #34

vid opened this issue Mar 3, 2015 · 8 comments

Comments

@vid
Copy link

vid commented Mar 3, 2015

It's not trappable. I would like to close database connections before restarting.

http://nodejs.org/api/process.html#process_signal_events

thanks!

@gimm
Copy link
Owner

gimm commented Mar 5, 2015

just want to kill the child_process.
Don't know much about nodejs signals here, any better suggestion here?

@vid
Copy link
Author

vid commented Mar 5, 2015

You should be able to use a milder signal like SIGHUP.

@gimm
Copy link
Owner

gimm commented Mar 7, 2015

@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 ?

@vid
Copy link
Author

vid commented Mar 7, 2015

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.

@gimm
Copy link
Owner

gimm commented Mar 8, 2015

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.

@cybrown
Copy link

cybrown commented May 19, 2015

+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

@gimm
Copy link
Owner

gimm commented May 24, 2015

please use https://github.com/gimm/gulp-live-server instead of gulp-express, I'll apply your change to gulp-live-server soon

@cybrown
Copy link

cybrown commented May 26, 2015

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants