BergmannLab / MONET

MONET : MOdularising NEtwork Toolbox - https://doi.org/10.1093/bioinformatics/btaa236
GNU General Public License v3.0
41 stars 15 forks source link

Ctrl-C does not stop monet #9

Open mattiat opened 4 years ago

mattiat commented 4 years ago

Launch clean up action in case monet is interrupted by keyboard

mattiat commented 4 years ago

I was going to try a simple trapping: https://rimuhosting.com/knowledgebase/linux/misc/trapping-ctrl-c-in-bash

Unfortunately this does not work for docker: once the docker run command is invoked by MONET, control passes to docker, which cannot be killed by Ctrl-C: https://stackoverflow.com/questions/54946227/how-to-exit-and-kill-the-running-docker-container-with-ctrlc

mattiat commented 4 years ago

instead of trapping Ctrl-C, I added an option to kill containers the "docker way" (i.e. using docker stop). https://github.com/BergmannLab/MONET/commit/54a493098a621cd90b4bcdccbce4dba1b4167205

mattiat commented 4 years ago

Trickier for singularity, I can't find any "stop" command. https://stackoverflow.com/questions/59791791/stopping-a-singularity-container

mattiat commented 4 years ago

Resorted to keeping track of monet's pid and killing that. https://github.com/BergmannLab/MONET/commit/9ee778e6bc2a42ca9b47d76871c50935e63fb2bb

Ready for testing.

mattiat commented 4 years ago

Joan and Sergio are going to test this.