containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.93k stars 2.43k forks source link

Podman should support starting containers again after they have exited #202

Closed mheon closed 6 years ago

mheon commented 6 years ago

Right now, conmon stops monitoring a container and exits once the container has exited. This means we cannot monitor containers once they have exited, so if a container is started again we cannot get its exit status (amongst other things). If we want to support restarting containers, we will need to add a way to start conmon that monitors runc but does not create the container in runc.

rhatdan commented 6 years ago

We at least report an error when this happens now.

sunilcio commented 6 years ago

Hi,

Tried with podman version podman-0-0.3.git367213a.fc27.x86_64 and see it failing with exit status 1

# podman start nostalgic_lovelace
cannot start a container that has stopped
unable to start nostalgic_lovelace: `/usr/bin/runc start 434fbd7ae289bdf1ebb1bf934bd09d1ad05e652e70d44ef852f3c4762edc01ec` failed: exit status 1
# podman ps -a
CONTAINER ID   IMAGE    COMMAND      CREATED AT                      STATUS                      PORTS   NAMES
434fbd7ae289   alpine   sleep 1000   2018-02-16 12:23:34 -0500 EST   Exited (0) 36 minutes ago           nostalgic_lovelace
0465728fe201   alpine   sh           2018-02-16 11:29:19 -0500 EST   Exited (0) 2 hours ago              compassionate_bassi
2e9e6ed2ed2c   fedora   sh           2018-02-16 11:27:51 -0500 EST   Exited (127) 2 hours ago            cranky_ride
mheon commented 6 years ago

Fixed upstream