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

Catch SIGTERM signal to gracefully terminate #2

Closed
pataquets opened this issue May 17, 2017 · 3 comments
Closed

Catch SIGTERM signal to gracefully terminate #2

pataquets opened this issue May 17, 2017 · 3 comments

Comments

@pataquets
Copy link
Contributor

While dockerizing the app, I've found that it ignores SIGTERM signals from both CTRL+C and docker stop commands (it just gets killed after 10 seconds in the later case).
Trapping SIGTERM signal to terminate gracefully would prevent this annoyance.
Thank you for this useful app.

@hgoebl
Copy link
Owner

hgoebl commented May 28, 2017

I tried to manage this, but without success. Seams like Socket.IO is a bit nasty when an immediate shutdown is desired. If you want, you can try with branch https://github.com/hgoebl/nerdshow/tree/0.5.0-sigterm-and-upgrade-dep and create PR then. Don't have enough time currently.

@pataquets
Copy link
Contributor Author

pataquets commented Jul 24, 2017

Tested it and works OK, thank you.
Successfully viewed "About" demo slideshow and used remote without problem.
Excerpt from stdout:

Starting src_app_1
Attaching to src_app_1
app_1  | No argument given for folder - taking examples...
app_1  | Express serving `nerdshow` at http://localhost:8008/
app_1  | Process ID: 1
app_1  | Serving files in /usr/src/app/examples
app_1  | Socket connected! id: IJLvPL_ENvRnqJFdAAAA
app_1  | Socket connected! id: n7IyzoaLD_eRuFBsAAAB
app_1  | SIGTERM received, shutting down...
app_1  | express closed
app_1  | io closed
src_app_1 exited with code 0

PR sent as instructed.

@hgoebl hgoebl closed this as completed in #3 Jul 24, 2017
hgoebl added a commit that referenced this issue Jul 24, 2017
upgrade dependencies, listen on SIGTERM (fixes #2)
@hgoebl
Copy link
Owner

hgoebl commented Jul 24, 2017

Thanks for contributing @pataquets
npm published minutes ago.

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

2 participants