artefactual-labs / am

Development environment for Archivematica
https://archivematica.org
GNU Affero General Public License v3.0
10 stars 20 forks source link

Problem: can't signal applications with intermediate shell #51

Closed sevein closed 5 years ago

sevein commented 6 years ago

I can't signal a process inside a container because we're running an intermediate shell.

For example: I want to send a HUP to Gunicorn inside the Dashboard so the application is reloaded. I used the the following command:

$ docker-compose kill -s HUP archivematica-dashboard

The signal is trap by the shell and it's not broadcasted, namely PID 1 is:

/bin/sh -c /usr/local/bin/gunicorn --config=/etc/archivematica/dashboard.gunicorn-config.py wsgi:application

We would need to change the ENTRYPOINT from:

ENTRYPOINT /usr/local/bin/gunicorn --config=/etc/archivematica/dashboard.gunicorn-config.py wsgi:application

To:

ENTRYPOINT ["/usr/local/bin/gunicorn", "--config=/etc/archivematica/dashboard.gunicorn-config.py", "wsgi:application"]

This problem seems to be occurring in other containers. It's bad because I can't signal our processes for graceful shutdowns, cancellation, etc... the solution can be easy though.

sevein commented 6 years ago

Example on how to fix this: https://github.com/JiscRDSS/archivematica/pull/53/commits/1fa8723bef456a8f854a868e3c7a399029b06419.

sevein commented 5 years ago

Fixed in https://github.com/artefactual/archivematica/commit/540acf453d64a19bc7f2ca0513a79a82156f49a4 (https://github.com/artefactual/archivematica/pull/1268, https://github.com/archivematica/Issues/issues/182).