summaryrefslogtreecommitdiff
path: root/cmd/podman/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/main.go')
-rw-r--r--cmd/podman/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index f936a332f..fefd8fdad 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -11,6 +11,7 @@ import (
"github.com/pkg/errors"
"github.com/projectatomic/libpod/pkg/hooks"
_ "github.com/projectatomic/libpod/pkg/hooks/0.1.0"
+ "github.com/projectatomic/libpod/pkg/rootless"
"github.com/projectatomic/libpod/version"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
@@ -26,6 +27,15 @@ func main() {
debug := false
cpuProfile := false
+ became, err := rootless.BecomeRootInUserNS()
+ if err != nil {
+ logrus.Errorf(err.Error())
+ os.Exit(1)
+ }
+ if became {
+ os.Exit(0)
+ }
+
if reexec.Init() {
return
}