From 48e35f7da70c24edd339bf29b83c427c48afcaab Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 29 May 2019 22:43:07 -0400 Subject: We can't pause rootless containers during cp Rootless containers can't be paused (no CGroups, so no freezer). We could try and emulate this with a SIGSTOP to all PIDs in the container, but that's inherently racy, so let's avoid it for now. Signed-off-by: Matthew Heon --- cmd/podman/cp.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/podman/cp.go b/cmd/podman/cp.go index a0677071d..406337955 100644 --- a/cmd/podman/cp.go +++ b/cmd/podman/cp.go @@ -13,6 +13,7 @@ import ( "github.com/containers/libpod/cmd/podman/cliconfig" "github.com/containers/libpod/cmd/podman/libpodruntime" "github.com/containers/libpod/libpod" + "github.com/containers/libpod/pkg/rootless" "github.com/containers/storage" "github.com/containers/storage/pkg/archive" "github.com/containers/storage/pkg/chrootarchive" @@ -95,7 +96,12 @@ func copyBetweenHostAndContainer(runtime *libpod.Runtime, src string, dest strin } defer ctr.Unmount(false) - if pause { + // We can't pause rootless containers. + if pause && rootless.IsRootless() { + logrus.Warnf("Cannot pause rootless containers - pause option will be ignored") + } + + if pause && !rootless.IsRootless() { if err := ctr.Pause(); err != nil { // An invalid state error is fine. // The container isn't running or is already paused. -- cgit v1.2.3-54-g00ecf