How to kill ros running in Docker with SSH disconnect, SIGHUP
I have two machines on the same LAN. One has an SSH server and also runs a Docker container. The other, I use as the client. I use that to SSH to the server machine, and then send a command to the container on that machine:
ssh -X -t user@server_host 'docker exec -it docker_container\
bash -ci roslaunch foo foo.launch;bash'
Perhaps this is not best practice?
I would like the processes opened here to all be killed when I close the ssh connection. However, it does not seem to detect SIGHUP.
I tried the same commands to a native non-docker machine with the same setup and SIGHUP properly kills everything when I close.
Is this possible or do I have to send a manual docker kill command? I like the simplicity of just closing my SSH windows
Asked by mugetsu on 2020-06-04 21:36:16 UTC
Comments
This is not an answer, but: I typically do this:
no need to source
.bashrc
(ie: interactive login) and everything will still work with the ROS environmentenv.sh
is part of.This is essentially what
roslaunch
does when you start things remotely with themachine
element (although it starts nodes directly and doesn't useroslaunch
itself).Asked by gvdhoorn on 2020-06-05 04:22:29 UTC
@gvdhoorn thanks for the method, good to know that non-interactive login is possible.
Asked by mugetsu on 2020-06-05 17:03:18 UTC