podman/pkg
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
..
annotations Spell check strings and comments 2018-05-25 08:45:15 +00:00
apparmor apparmor: don't load default profile in rootless mode 2019-01-29 10:38:52 -05:00
chrootuser Generate a passwd file for users not in container 2018-10-12 07:08:13 -04:00
criu Add helper function to read out CRIU version 2018-10-23 12:52:03 +02:00
ctime ctime: Drop 32-/64-bit distinction on Linux 2018-07-07 20:35:00 +00:00
firewall Replace existing iptables handler with firewall code 2018-09-10 18:53:27 +00:00
hooks pkg/hooks/exec: Include failed command in hook errors 2019-01-08 21:06:17 -08:00
inspect Switch all referencs to image.ContainerConfig to image.Config 2018-12-21 15:59:34 -05:00
kubeutils Remove dependency on kubernetes 2018-03-27 21:55:33 +00:00
logs Add CRI logs parsing to podman logs 2018-09-05 13:48:20 +00:00
lookup pkg/lookup: Return ID-only pointers on ErrNo*Entries 2018-12-04 14:46:43 -08:00
namespaces Change all 'can not' to 'cannot' for proper usage 2018-12-21 10:27:54 -05:00
netns Fix godoc comment in pkg/netns 2018-07-27 02:48:16 +00:00
registrar Initial checkin from CRI-O repo 2017-11-01 11:24:59 -04:00
registries Factor out the registries.conf location code in pkg/registries 2018-12-06 23:34:59 +01:00
resolvconf Use host's resolv.conf if no network namespace enabled 2018-11-27 15:28:09 -05:00
rootless Cleanup coverity scan issues 2019-01-15 17:09:15 -05:00
secrets rootless: create empty mounts.conf if it doesn't exist 2018-11-19 12:58:11 +01:00
spec Fix manual detach from containers to not wait for exit 2019-02-12 10:14:57 -05:00
sysinfo apparmor: apply default profile at container initialization 2019-01-09 22:18:11 +01:00
trust Fix up image sign in PR 2108 2019-01-15 12:25:10 -05:00
util Unconditionally refresh storage options from config 2019-02-06 10:01:43 -05:00
varlinkapi podman-remote volume rm 2019-02-11 20:14:50 -06:00