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

Docker signal handling #43

Closed
deployable opened this Issue Oct 5, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@deployable
Contributor

deployable commented Oct 5, 2016

The current docker setup does not handle sigint (ctrl-c) or sigterm (docker stop) so the process needs to be killed with a sigkill to stop it.

@deployable

This comment has been minimized.

Contributor

deployable commented Oct 5, 2016

#42

@jdxcode

This comment has been minimized.

Owner

jdxcode commented Oct 5, 2016

The application does seem to respond to those signals:

$ npm start

> npm-register@2.0.2 start /Users/jdickey/src/github.com/dickeyxxx/npm-register
> ./bin/npm-register start

Opbeat agent is inactive due to configuration
Saving files to local filesystem at /Users/jdickey/src/github.com/dickeyxxx/npm-register/tmp
npm-register listening on port 3000 [development]
fish: 'npm start' terminated by signal SIGTERM (Polite quit request)
$ npm start

> npm-register@2.0.2 start /Users/jdickey/src/github.com/dickeyxxx/npm-register
> ./bin/npm-register start

Opbeat agent is inactive due to configuration
Saving files to local filesystem at /Users/jdickey/src/github.com/dickeyxxx/npm-register/tmp
npm-register listening on port 3000 [development]
fish: 'npm start' terminated by signal SIGKILL (Forced quit)
@deployable

This comment has been minimized.

Contributor

deployable commented Oct 5, 2016

Sorry, it looks like they do have a handler for SIGTERM in npm v3 at least. Just not a SIGINT. I assumed it was both when I ran into the issue.

The problem doesn't appear when running npm start manually. Only when the command is launched by docker as PID 1 via CMD [ "npm", "start" ]

$ docker run deployable/npm-register

> npm-register@2.0.2 start /srv/npm-register
> ./bin/npm-register start

Opbeat agent is inactive due to configuration
Saving files to local filesystem at /data
npm-register listening on port 3000 [production]
^C^C^C^C

Then without npm

$ docker run deployable/npm-register
Opbeat agent is inactive due to configuration
Saving files to local filesystem at /data
npm-register listening on port 3000 [production]
^CRecieved SIGINT, exiting

npm/npm#4603 (comment)

@dgautsch dgautsch added the bug label Oct 14, 2017

@dgautsch

This comment has been minimized.

Collaborator

dgautsch commented Oct 21, 2018

No traction on this for a while. Closing for now.

@dgautsch dgautsch closed this Oct 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment