I have a docker container running that is shared by some people who are not too experienced with using command line tools. A user "logs in" by docker exec -it container_name bash.
If one starts up a process like python but then gets disconnected from the network, the python process is not terminated and continues to use resources. I know that people familiar with command line tools can find this python process by ps aux or similar, but in the interest of the people I help I was wondering if there is a way to automatically terminate processes of a user if they exit or lose connection from the container?