Open mattiat opened 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
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
Trickier for singularity, I can't find any "stop" command. https://stackoverflow.com/questions/59791791/stopping-a-singularity-container
Resorted to keeping track of monet's pid and killing that. https://github.com/BergmannLab/MONET/commit/9ee778e6bc2a42ca9b47d76871c50935e63fb2bb
Ready for testing.
Joan and Sergio are going to test this.
Launch clean up action in case monet is interrupted by keyboard