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

Forever does not respond to SIGTERM? #1092

Open
adams-family opened this issue Jul 12, 2020 · 0 comments
Open

Forever does not respond to SIGTERM? #1092

adams-family opened this issue Jul 12, 2020 · 0 comments

Comments

@adams-family
Copy link

adams-family commented Jul 12, 2020

I think that forever does not react to SIGTERM signal in any way. Here is an example:

Given the following setup in Docker:

# docker-compose.yml
version: "3.7"
services:
  node:
    build: .
    restart: always
    command: 'forever -w --minUptime 5000 --spinSleepTime 3000 --killSignal SIGTERM server.js'
# Dockerfile
FROM node:10.12.0

WORKDIR /usr/src/app

RUN npm install forever -g
// server.js
process.on('SIGTERM', function () { console.log('Received SIGTERM'); process.exit(0); });
setInterval(() => console.log('.'));

Start the above with docker-compose up everything is running fine.

Current behavior:

When Ctrl-C is pressed, Docker sends SIGTERM immediately and nothing happens. After 10s Docker sends SIGKILL and this is the moment when both forever and my app stop.

Expected behavior:

When Ctrl-C is pressed, Docker sends SIGTERM immediately and forever should forward SIGTERM to the node process immediately IMO.

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

1 participant