Skip to content

restart_container

Thomas Holterbach edited this page Apr 24, 2022 · 9 revisions

Restart a container

It can happen that a container crashes while the mini-Internet is running. It is a hassle to restart a container and manually connect it to the other containers according to the topology. The mini-Internet automatically generates the script restart_container.sh during startup. This script enables to reconnect a container to the other containers automatically.

For instance if the container CONTAINER_NAME has crashed or has a problem, just run the following commands:

docker kill CONTAINER_NAME
docker start CONTAINER_NAME
./groups/restart_container.sh CONTAINER_NAME

ℹ️ This script can take few minutes.

ℹ️ Sometimes the MAC address on some interfaces must follow a particular scheme (for instance the ones connected to the MATRIX container). Configuring these MAC addresses must be done manually.

Restarting the SSH proxy container

It can happen that an SSH container fails if a student starts more than 100 processes in it (100 is the max number of processes that can run in this container). When this problem occurs, you can't access the docker container anymore, and you need to restart it following the procedure depicted above. Besides restarting the docker container, you also need to re-enable the SSH port forwarding for that particular SSH proxy container. You can do that from the main server with the following command:

ssh -i groups/id_rsa -o UserKnownHostsFile=/dev/null -o "StrictHostKeyChecking no" -f -N -L 0.0.0.0:[2000+X]:157.0.0.[X+10]:22 [email protected].[X+10]

Where X is the group number.