Commit graph

3 commits

Author SHA1 Message Date
Matthew Heon d83d0abfbf Ensure that start() in StartAndAttach() is locked
StartAndAttach() runs start() in a goroutine, which can allow it
to fire after the caller returns - and thus, after the defer to
unlock the container lock has fired.

The start() call _must_ occur while the container is locked, or
else state inconsistencies may occur.

Fixes #3114

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-14 14:54:21 -04:00
Matthew Heon b6775d5d22 Fix manual detach from containers to not wait for exit
At present, when manually detaching from an attached container
(using the detach hotkeys, default C-p C-q), Podman will still
wait for the container to exit to obtain its exit code (so we can
set Podman's exit code to match). This is correct in the case
where attach finished because the container exited, but very
wrong for the manual detach case.

As a result of this, we can no longer guarantee that the cleanup
and --rm functions will fire at the end of 'podman run' - we may
be exiting before we get that far. Cleanup is easy enough - we
swap to unconditionally using the cleanup processes we've used
for detached and rootless containers all along. To duplicate --rm
we need to also teach 'podman cleanup' to optionally remove
containers instead of cleaning them up.

(There is an argument for just using 'podman rm' instead of
'podman cleanup --rm', but cleanup does have different semantics
given that we only ever expect it to run when the container has
just exited. I think it might be useful to keep the two separate
for things like 'podman events'...)

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-02-12 10:14:57 -05:00
baude 43c6da22b9 Add darwin support for remote-client
Add the ability to cross-compile podman remote for OSX.

Also, add image exists and tag to remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-11 11:30:28 -06:00
Renamed from libpod/container_attach.go (Browse further)