elifesciences / elife-xpub

eLife is an open-access journal and technology provider that publishes promising research in the life and biomedical sciences. This is their implementation of a submission and peer review system based on Coko PubSweet and xPub.
https://elifesciences.org/
MIT License
32 stars 5 forks source link

Add a wrapper script to handle signals #1724

Open erezmus opened 5 years ago

erezmus commented 5 years ago

When running on a docker container, the /bin/sh is the main process with PID 1. According to docker documentation (https://docs.docker.com/engine/reference/run/#foreground)

Note: A process running as PID 1 inside a container is treated specially by Linux: it ignores any signal with the default action. So, the process will not terminate on SIGINT or SIGTERM unless it is coded to do so.

Hence we need to write a wrapper script to replace the current command in docker-compose script that will:

Found a blog post from codeship that should help: https://blog.codeship.com/trapping-signals-in-docker-containers/

This ticket follows from #1676

diversemix commented 5 years ago

There is a branch 1724-add-wrapper-start-script but PR is closed as too old.